pub struct Offset { /* private fields */ }
Expand description

An absolute (non-negative) offset from the beginning of a core.

Implementations§

source§

impl Offset

source

pub fn new(value: i32, core_size: u32) -> Self

Create a new Offset. The value will be adjusted to be within bounds of the core.

§Panics

If core_size is invalid. Both 0 and u32::MAX are disallowed.

source

pub fn value(&self) -> u32

Get the value of the offset. This will always be less than the core size.

source

pub fn set_value(&mut self, value: i32)

Set the value of the offset. The value will be adjusted to be within bounds of the core size.

Trait Implementations§

source§

impl Add<i32> for Offset

§

type Output = Offset

The resulting type after applying the + operator.
source§

fn add(self, rhs: i32) -> Self::Output

Performs the + operation. Read more
source§

impl Add<u32> for Offset

§

type Output = Offset

The resulting type after applying the + operator.
source§

fn add(self, rhs: u32) -> Self::Output

Performs the + operation. Read more
source§

impl Add for Offset

source§

fn add(self, rhs: Self) -> Self

Panics if the right-hand side has a different core_size than the left-hand side.

§

type Output = Offset

The resulting type after applying the + operator.
source§

impl AddAssign<i32> for Offset

source§

fn add_assign(&mut self, rhs: i32)

Performs the += operation. Read more
source§

impl AddAssign<u32> for Offset

source§

fn add_assign(&mut self, rhs: u32)

Performs the += operation. Read more
source§

impl AddAssign for Offset

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl Clone for Offset

source§

fn clone(&self) -> Offset

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Offset

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Offset

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div<i32> for Offset

§

type Output = Offset

The resulting type after applying the / operator.
source§

fn div(self, rhs: i32) -> Self::Output

Performs the / operation. Read more
source§

impl Div<u32> for Offset

§

type Output = Offset

The resulting type after applying the / operator.
source§

fn div(self, rhs: u32) -> Self::Output

Performs the / operation. Read more
source§

impl Div for Offset

source§

fn div(self, rhs: Self) -> Self

Panics if the right-hand side has a different core_size than the left-hand side.

§

type Output = Offset

The resulting type after applying the / operator.
source§

impl DivAssign<i32> for Offset

source§

fn div_assign(&mut self, rhs: i32)

Performs the /= operation. Read more
source§

impl DivAssign<u32> for Offset

source§

fn div_assign(&mut self, rhs: u32)

Performs the /= operation. Read more
source§

impl DivAssign for Offset

source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
source§

impl Mul<i32> for Offset

§

type Output = Offset

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<u32> for Offset

§

type Output = Offset

The resulting type after applying the * operator.
source§

fn mul(self, rhs: u32) -> Self::Output

Performs the * operation. Read more
source§

impl Mul for Offset

source§

fn mul(self, rhs: Self) -> Self

Panics if the right-hand side has a different core_size than the left-hand side.

§

type Output = Offset

The resulting type after applying the * operator.
source§

impl MulAssign<i32> for Offset

source§

fn mul_assign(&mut self, rhs: i32)

Performs the *= operation. Read more
source§

impl MulAssign<u32> for Offset

source§

fn mul_assign(&mut self, rhs: u32)

Performs the *= operation. Read more
source§

impl MulAssign for Offset

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl PartialEq for Offset

source§

fn eq(&self, other: &Offset) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Rem<i32> for Offset

§

type Output = Offset

The resulting type after applying the % operator.
source§

fn rem(self, rhs: i32) -> Self::Output

Performs the % operation. Read more
source§

impl Rem<u32> for Offset

§

type Output = Offset

The resulting type after applying the % operator.
source§

fn rem(self, rhs: u32) -> Self::Output

Performs the % operation. Read more
source§

impl Rem for Offset

source§

fn rem(self, rhs: Self) -> Self

Panics if the right-hand side has a different core_size than the left-hand side.

§

type Output = Offset

The resulting type after applying the % operator.
source§

impl RemAssign<i32> for Offset

source§

fn rem_assign(&mut self, rhs: i32)

Performs the %= operation. Read more
source§

impl RemAssign<u32> for Offset

source§

fn rem_assign(&mut self, rhs: u32)

Performs the %= operation. Read more
source§

impl RemAssign for Offset

source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
source§

impl Sub<i32> for Offset

§

type Output = Offset

The resulting type after applying the - operator.
source§

fn sub(self, rhs: i32) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<u32> for Offset

§

type Output = Offset

The resulting type after applying the - operator.
source§

fn sub(self, rhs: u32) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for Offset

source§

fn sub(self, rhs: Self) -> Self

Panics if the right-hand side has a different core_size than the left-hand side.

§

type Output = Offset

The resulting type after applying the - operator.
source§

impl SubAssign<i32> for Offset

source§

fn sub_assign(&mut self, rhs: i32)

Performs the -= operation. Read more
source§

impl SubAssign<u32> for Offset

source§

fn sub_assign(&mut self, rhs: u32)

Performs the -= operation. Read more
source§

impl SubAssign for Offset

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl Copy for Offset

source§

impl Eq for Offset

source§

impl StructuralPartialEq for Offset

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.