pub struct Unused<T> { /* private fields */ }
Expand description
A wrapper around a value that is unused.
Implementations§
Source§impl<T> Unused<T>
impl<T> Unused<T>
Sourcepub unsafe fn new_unchecked(inner: T) -> Self
pub unsafe fn new_unchecked(inner: T) -> Self
Sourcepub unsafe fn get_unchecked(&self) -> &T
pub unsafe fn get_unchecked(&self) -> &T
Get the inner value, without consuming the Unused
wrapper.
§Safety
The user need to make sure that the value stays unused.
Auto Trait Implementations§
impl<T> Freeze for Unused<T>where
T: Freeze,
impl<T> RefUnwindSafe for Unused<T>where
T: RefUnwindSafe,
impl<T> Send for Unused<T>where
T: Send,
impl<T> Sync for Unused<T>where
T: Sync,
impl<T> Unpin for Unused<T>where
T: Unpin,
impl<T> UnwindSafe for Unused<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more