pub struct ShouldNotBeZero<T>(/* private fields */)
where
T: ZeroableThing;Expand description
Describes something that is valid when passed as a zero but SHOULDN’T BE a zero
mainly for usage with FFI and OptZero so that if it was passed as a zero it would be treated as a None value
Implementations§
Source§impl<T> ShouldNotBeZero<T>where
T: ZeroableThing,
impl<T> ShouldNotBeZero<T>where
T: ZeroableThing,
pub fn new(value: T) -> Option<ShouldNotBeZero<T>>
pub const unsafe fn new_unchecked(value: T) -> ShouldNotBeZero<T>
pub const fn value_ref(&self) -> &T
Source§impl<T> ShouldNotBeZero<T>where
T: ZeroableThing + Copy,
impl<T> ShouldNotBeZero<T>where
T: ZeroableThing + Copy,
Trait Implementations§
Source§impl<T> Clone for ShouldNotBeZero<T>where
T: Clone + ZeroableThing,
impl<T> Clone for ShouldNotBeZero<T>where
T: Clone + ZeroableThing,
Source§fn clone(&self) -> ShouldNotBeZero<T>
fn clone(&self) -> ShouldNotBeZero<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for ShouldNotBeZero<T>where
T: Debug + ZeroableThing,
impl<T> Debug for ShouldNotBeZero<T>where
T: Debug + ZeroableThing,
Source§impl<T> Hash for ShouldNotBeZero<T>where
T: Hash + ZeroableThing,
impl<T> Hash for ShouldNotBeZero<T>where
T: Hash + ZeroableThing,
Source§impl<T> NotZeroable for ShouldNotBeZero<T>where
T: ZeroableThing,
impl<T> NotZeroable for ShouldNotBeZero<T>where
T: ZeroableThing,
Source§impl<T> PartialEq for ShouldNotBeZero<T>where
T: PartialEq + ZeroableThing,
impl<T> PartialEq for ShouldNotBeZero<T>where
T: PartialEq + ZeroableThing,
impl<T> Copy for ShouldNotBeZero<T>where
T: Copy + ZeroableThing,
impl<T> Eq for ShouldNotBeZero<T>where
T: Eq + ZeroableThing,
impl<T> StructuralPartialEq for ShouldNotBeZero<T>where
T: ZeroableThing,
Auto Trait Implementations§
impl<T> Freeze for ShouldNotBeZero<T>where
T: Freeze,
impl<T> RefUnwindSafe for ShouldNotBeZero<T>where
T: RefUnwindSafe,
impl<T> Send for ShouldNotBeZero<T>where
T: Send,
impl<T> Sync for ShouldNotBeZero<T>where
T: Sync,
impl<T> Unpin for ShouldNotBeZero<T>where
T: Unpin,
impl<T> UnwindSafe for ShouldNotBeZero<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