#[repr(transparent)]pub struct Octave<T = isize>(pub T);Expand description
A type defining an octave
Tuple Fields§
§0: TImplementations§
Source§impl<T> Octave<T>
impl<T> Octave<T>
Sourcepub const fn new(octave: T) -> Self
pub const fn new(octave: T) -> Self
a functional constructor for Octave, essentially wrapping the given value
Sourcepub fn create<F>(f: F) -> Selfwhere
F: FnOnce() -> T,
pub fn create<F>(f: F) -> Selfwhere
F: FnOnce() -> T,
returns a new Octave with the output of the given initializer function
Sourcepub const fn as_mut_ptr(&mut self) -> *mut T
pub const fn as_mut_ptr(&mut self) -> *mut T
returns a mutable pointer to the inner value
Sourcepub fn map<U, F>(self, f: F) -> Octave<U>where
F: FnOnce(T) -> U,
pub fn map<U, F>(self, f: F) -> Octave<U>where
F: FnOnce(T) -> U,
apply a function to the inner value and returns a new Octave wrapping the result
Sourcepub const fn replace(&mut self, index: T) -> T
pub const fn replace(&mut self, index: T) -> T
replaces the inner value with the given one and returns the old value
Sourcepub fn with<U>(self, other: U) -> Octave<U>
pub fn with<U>(self, other: U) -> Octave<U>
consumes the current instance to create another with the given value
Sourcepub fn take(&mut self) -> Twhere
T: Default,
pub fn take(&mut self) -> Twhere
T: Default,
takes and returns the inner value, replacing it with the logical default
of the type T
Trait Implementations§
Source§impl<'a, _A, _B, _C> Add<&'a mut Octave<_B>> for Octave<_A>where
_A: Add<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Add<&'a mut Octave<_B>> for Octave<_A>where
_A: Add<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Add<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Add<_B, Output = _C>,
impl<'a, _A, _B, _C> Add<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Add<_B, Output = _C>,
Source§impl<_A, _B> AddAssign<Octave<_B>> for Octave<_A>where
_A: AddAssign<_B>,
impl<_A, _B> AddAssign<Octave<_B>> for Octave<_A>where
_A: AddAssign<_B>,
Source§fn add_assign(&mut self, rhs: Octave<_B>)
fn add_assign(&mut self, rhs: Octave<_B>)
Performs the
+= operation. Read moreSource§impl<'a, _A, _B, _C> BitAnd<&'a mut Octave<_B>> for Octave<_A>where
_A: BitAnd<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> BitAnd<&'a mut Octave<_B>> for Octave<_A>where
_A: BitAnd<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> BitAnd<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: BitAnd<_B, Output = _C>,
impl<'a, _A, _B, _C> BitAnd<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: BitAnd<_B, Output = _C>,
Source§impl<_A, _B> BitAndAssign<Octave<_B>> for Octave<_A>where
_A: BitAndAssign<_B>,
impl<_A, _B> BitAndAssign<Octave<_B>> for Octave<_A>where
_A: BitAndAssign<_B>,
Source§fn bitand_assign(&mut self, rhs: Octave<_B>)
fn bitand_assign(&mut self, rhs: Octave<_B>)
Performs the
&= operation. Read moreSource§impl<'a, _A, _B, _C> BitOr<&'a mut Octave<_B>> for Octave<_A>where
_A: BitOr<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> BitOr<&'a mut Octave<_B>> for Octave<_A>where
_A: BitOr<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> BitOr<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: BitOr<_B, Output = _C>,
impl<'a, _A, _B, _C> BitOr<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: BitOr<_B, Output = _C>,
Source§impl<_A, _B> BitOrAssign<Octave<_B>> for Octave<_A>where
_A: BitOrAssign<_B>,
impl<_A, _B> BitOrAssign<Octave<_B>> for Octave<_A>where
_A: BitOrAssign<_B>,
Source§fn bitor_assign(&mut self, rhs: Octave<_B>)
fn bitor_assign(&mut self, rhs: Octave<_B>)
Performs the
|= operation. Read moreSource§impl<'a, _A, _B, _C> BitXor<&'a mut Octave<_B>> for Octave<_A>where
_A: BitXor<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> BitXor<&'a mut Octave<_B>> for Octave<_A>where
_A: BitXor<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> BitXor<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: BitXor<_B, Output = _C>,
impl<'a, _A, _B, _C> BitXor<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: BitXor<_B, Output = _C>,
Source§impl<_A, _B> BitXorAssign<Octave<_B>> for Octave<_A>where
_A: BitXorAssign<_B>,
impl<_A, _B> BitXorAssign<Octave<_B>> for Octave<_A>where
_A: BitXorAssign<_B>,
Source§fn bitxor_assign(&mut self, rhs: Octave<_B>)
fn bitxor_assign(&mut self, rhs: Octave<_B>)
Performs the
^= operation. Read moreSource§impl<T> BorrowMut<T> for Octave<T>
impl<T> BorrowMut<T> for Octave<T>
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<'a, _A, _B, _C> Div<&'a mut Octave<_B>> for Octave<_A>where
_A: Div<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Div<&'a mut Octave<_B>> for Octave<_A>where
_A: Div<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Div<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Div<_B, Output = _C>,
impl<'a, _A, _B, _C> Div<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Div<_B, Output = _C>,
Source§impl<_A, _B> DivAssign<Octave<_B>> for Octave<_A>where
_A: DivAssign<_B>,
impl<_A, _B> DivAssign<Octave<_B>> for Octave<_A>where
_A: DivAssign<_B>,
Source§fn div_assign(&mut self, rhs: Octave<_B>)
fn div_assign(&mut self, rhs: Octave<_B>)
Performs the
/= operation. Read moreSource§impl<'a, _A, _B, _C> Mul<&'a mut Octave<_B>> for Octave<_A>where
_A: Mul<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Mul<&'a mut Octave<_B>> for Octave<_A>where
_A: Mul<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Mul<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Mul<_B, Output = _C>,
impl<'a, _A, _B, _C> Mul<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Mul<_B, Output = _C>,
Source§impl<_A, _B> MulAssign<Octave<_B>> for Octave<_A>where
_A: MulAssign<_B>,
impl<_A, _B> MulAssign<Octave<_B>> for Octave<_A>where
_A: MulAssign<_B>,
Source§fn mul_assign(&mut self, rhs: Octave<_B>)
fn mul_assign(&mut self, rhs: Octave<_B>)
Performs the
*= operation. Read moreSource§impl<T> Num for Octave<T>where
T: Num,
impl<T> Num for Octave<T>where
T: Num,
type FromStrRadixErr = <T as Num>::FromStrRadixErr
Source§fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
Convert from a string and radix (typically
2..=36). Read moreSource§impl<T: Ord> Ord for Octave<T>
impl<T: Ord> Ord for Octave<T>
Source§impl<'a, T> PartialOrd<&'a T> for Octave<T>where
T: PartialOrd,
impl<'a, T> PartialOrd<&'a T> for Octave<T>where
T: PartialOrd,
Source§impl<'a, T> PartialOrd<&'a mut T> for Octave<T>where
T: PartialOrd,
impl<'a, T> PartialOrd<&'a mut T> for Octave<T>where
T: PartialOrd,
Source§impl<T> PartialOrd<T> for Octave<T>where
T: PartialOrd,
impl<T> PartialOrd<T> for Octave<T>where
T: PartialOrd,
Source§impl<T: PartialOrd> PartialOrd for Octave<T>
impl<T: PartialOrd> PartialOrd for Octave<T>
Source§impl<'a, _A, _B, _C> Rem<&'a mut Octave<_B>> for Octave<_A>where
_A: Rem<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Rem<&'a mut Octave<_B>> for Octave<_A>where
_A: Rem<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Rem<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Rem<_B, Output = _C>,
impl<'a, _A, _B, _C> Rem<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Rem<_B, Output = _C>,
Source§impl<_A, _B> RemAssign<Octave<_B>> for Octave<_A>where
_A: RemAssign<_B>,
impl<_A, _B> RemAssign<Octave<_B>> for Octave<_A>where
_A: RemAssign<_B>,
Source§fn rem_assign(&mut self, rhs: Octave<_B>)
fn rem_assign(&mut self, rhs: Octave<_B>)
Performs the
%= operation. Read moreSource§impl<'a, _A, _B, _C> Shl<&'a mut Octave<_B>> for Octave<_A>where
_A: Shl<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Shl<&'a mut Octave<_B>> for Octave<_A>where
_A: Shl<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Shl<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Shl<_B, Output = _C>,
impl<'a, _A, _B, _C> Shl<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Shl<_B, Output = _C>,
Source§impl<_A, _B> ShlAssign<Octave<_B>> for Octave<_A>where
_A: ShlAssign<_B>,
impl<_A, _B> ShlAssign<Octave<_B>> for Octave<_A>where
_A: ShlAssign<_B>,
Source§fn shl_assign(&mut self, rhs: Octave<_B>)
fn shl_assign(&mut self, rhs: Octave<_B>)
Performs the
<<= operation. Read moreSource§impl<'a, _A, _B, _C> Shr<&'a mut Octave<_B>> for Octave<_A>where
_A: Shr<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Shr<&'a mut Octave<_B>> for Octave<_A>where
_A: Shr<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Shr<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Shr<_B, Output = _C>,
impl<'a, _A, _B, _C> Shr<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Shr<_B, Output = _C>,
Source§impl<_A, _B> ShrAssign<Octave<_B>> for Octave<_A>where
_A: ShrAssign<_B>,
impl<_A, _B> ShrAssign<Octave<_B>> for Octave<_A>where
_A: ShrAssign<_B>,
Source§fn shr_assign(&mut self, rhs: Octave<_B>)
fn shr_assign(&mut self, rhs: Octave<_B>)
Performs the
>>= operation. Read moreSource§impl<'a, _A, _B, _C> Sub<&'a mut Octave<_B>> for Octave<_A>where
_A: Sub<&'a mut _B, Output = _C>,
impl<'a, _A, _B, _C> Sub<&'a mut Octave<_B>> for Octave<_A>where
_A: Sub<&'a mut _B, Output = _C>,
Source§impl<'a, _A, _B, _C> Sub<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Sub<_B, Output = _C>,
impl<'a, _A, _B, _C> Sub<Octave<_B>> for &'a mut Octave<_A>where
&'a mut _A: Sub<_B, Output = _C>,
Source§impl<_A, _B> SubAssign<Octave<_B>> for Octave<_A>where
_A: SubAssign<_B>,
impl<_A, _B> SubAssign<Octave<_B>> for Octave<_A>where
_A: SubAssign<_B>,
Source§fn sub_assign(&mut self, rhs: Octave<_B>)
fn sub_assign(&mut self, rhs: Octave<_B>)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for Octave<T>
impl<T: Eq> Eq for Octave<T>
impl<T> StructuralPartialEq for Octave<T>
Auto Trait Implementations§
impl<T> Freeze for Octave<T>where
T: Freeze,
impl<T> RefUnwindSafe for Octave<T>where
T: RefUnwindSafe,
impl<T> Send for Octave<T>where
T: Send,
impl<T> Sync for Octave<T>where
T: Sync,
impl<T> Unpin for Octave<T>where
T: Unpin,
impl<T> UnwindSafe for Octave<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more