pub struct Constant<T>(/* private fields */);
Expand description
A tag using a ConstantSource
.
The only safe way to construct an ExactSize
is by copying the associated constant which
expresses the length indicated in the trait impl. This implies that the value is unique.
(Disregarding unsound rustc issues that allow duplicate trait impls).
Implementations§
source§impl<T: ConstantSource> Constant<T>
impl<T: ConstantSource> Constant<T>
sourcepub const EXACT_SIZE: ExactSize<Self> = _
pub const EXACT_SIZE: ExactSize<Self> = _
A constructed instance of ExactSize<Self>
.
The instance can be freely copied. Making this an associated constant ensures that the
length associated with the type is the associated LEN
constant while also permitting use
in const
environments, despite the ConstantSource
bound on the parameter. There are no
other safe constructors for this tag’s ExactSize
type.
Trait Implementations§
impl<T> Copy for Constant<T>
impl<T: ConstantSource> Tag for Constant<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Constant<T>
impl<T> Send for Constant<T>
impl<T> Sync for Constant<T>
impl<T> Unpin for Constant<T>
impl<T> UnwindSafe for Constant<T>
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