pub struct RetainedBytes(/* private fields */);Expand description
Variable memory retained by one value.
Fixed collection and envelope overhead is bounded separately by item count.
Implementations§
Source§impl RetainedBytes
impl RetainedBytes
Sourcepub const ZERO: RetainedBytes
pub const ZERO: RetainedBytes
No retained variable memory.
Sourcepub const fn new(bytes: u64) -> RetainedBytes
pub const fn new(bytes: u64) -> RetainedBytes
Creates a retained-byte value.
Sourcepub const fn checked_add(self, other: RetainedBytes) -> Option<RetainedBytes>
pub const fn checked_add(self, other: RetainedBytes) -> Option<RetainedBytes>
Adds two byte counts, returning None on overflow.
Sourcepub const fn checked_sub(self, other: RetainedBytes) -> Option<RetainedBytes>
pub const fn checked_sub(self, other: RetainedBytes) -> Option<RetainedBytes>
Subtracts a byte count, returning None when other is larger.
Trait Implementations§
Source§impl Clone for RetainedBytes
impl Clone for RetainedBytes
Source§fn clone(&self) -> RetainedBytes
fn clone(&self) -> RetainedBytes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RetainedBytes
Source§impl Debug for RetainedBytes
impl Debug for RetainedBytes
Source§impl Default for RetainedBytes
impl Default for RetainedBytes
Source§fn default() -> RetainedBytes
fn default() -> RetainedBytes
Returns the “default value” for a type. Read more
impl Eq for RetainedBytes
Source§impl From<u32> for RetainedBytes
impl From<u32> for RetainedBytes
Source§fn from(value: u32) -> RetainedBytes
fn from(value: u32) -> RetainedBytes
Converts to this type from the input type.
Source§impl From<u64> for RetainedBytes
impl From<u64> for RetainedBytes
Source§fn from(value: u64) -> RetainedBytes
fn from(value: u64) -> RetainedBytes
Converts to this type from the input type.
Source§impl Hash for RetainedBytes
impl Hash for RetainedBytes
Source§impl Ord for RetainedBytes
impl Ord for RetainedBytes
Source§fn cmp(&self, other: &RetainedBytes) -> Ordering
fn cmp(&self, other: &RetainedBytes) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for RetainedBytes
impl PartialEq for RetainedBytes
Source§impl PartialOrd for RetainedBytes
impl PartialOrd for RetainedBytes
impl StructuralPartialEq for RetainedBytes
Source§impl TryFrom<usize> for RetainedBytes
impl TryFrom<usize> for RetainedBytes
Source§type Error = RetainedBytesOverflow
type Error = RetainedBytesOverflow
The type returned in the event of a conversion error.
Source§fn try_from(
value: usize,
) -> Result<RetainedBytes, <RetainedBytes as TryFrom<usize>>::Error>
fn try_from( value: usize, ) -> Result<RetainedBytes, <RetainedBytes as TryFrom<usize>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for RetainedBytes
impl RefUnwindSafe for RetainedBytes
impl Send for RetainedBytes
impl Sync for RetainedBytes
impl Unpin for RetainedBytes
impl UnsafeUnpin for RetainedBytes
impl UnwindSafe for RetainedBytes
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