pub struct ReadLimit(/* private fields */);Expand description
A checked read length in bytes: positive and at most ReadLimit::MAX,
the in-memory snapshot cap.
Implementations§
Source§impl ReadLimit
impl ReadLimit
Sourcepub const DEFAULT_TAIL: Self
pub const DEFAULT_TAIL: Self
The default tail window (256 KiB), also follow’s initial window.
Sourcepub fn new(value: u64) -> Result<Self, ReadLimitError>
pub fn new(value: u64) -> Result<Self, ReadLimitError>
Admit one length; zero and anything above ReadLimit::MAX are
refused before any transfer or allocation.
pub const fn get(self) -> u64
Trait Implementations§
impl Copy for ReadLimit
Source§impl<'de> Deserialize<'de> for ReadLimit
impl<'de> Deserialize<'de> for ReadLimit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ReadLimit
impl StructuralPartialEq for ReadLimit
Auto Trait Implementations§
impl Freeze for ReadLimit
impl RefUnwindSafe for ReadLimit
impl Send for ReadLimit
impl Sync for ReadLimit
impl Unpin for ReadLimit
impl UnsafeUnpin for ReadLimit
impl UnwindSafe for ReadLimit
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