pub struct FetchPackSizeLimit { /* private fields */ }
Expand description
Limiter for byte streams.
Default: 500MiB
Implementations§
Source§impl FetchPackSizeLimit
impl FetchPackSizeLimit
Sourcepub fn bytes(size: u64) -> FetchPackSizeLimit
pub fn bytes(size: u64) -> FetchPackSizeLimit
New FetchPackSizeLimit
in bytes.
Sourcepub fn kibibytes(size: u64) -> FetchPackSizeLimit
pub fn kibibytes(size: u64) -> FetchPackSizeLimit
New FetchPackSizeLimit
in kibibytes.
Sourcepub fn mebibytes(size: u64) -> FetchPackSizeLimit
pub fn mebibytes(size: u64) -> FetchPackSizeLimit
New FetchPackSizeLimit
in mebibytes.
Sourcepub fn gibibytes(size: u64) -> FetchPackSizeLimit
pub fn gibibytes(size: u64) -> FetchPackSizeLimit
New FetchPackSizeLimit
in gibibytes.
Sourcepub fn exceeded_by(&self, bytes: usize) -> bool
pub fn exceeded_by(&self, bytes: usize) -> bool
Check if this limit is exceeded by the number of bytes
provided.
Trait Implementations§
Source§impl Clone for FetchPackSizeLimit
impl Clone for FetchPackSizeLimit
Source§fn clone(&self) -> FetchPackSizeLimit
fn clone(&self) -> FetchPackSizeLimit
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 Debug for FetchPackSizeLimit
impl Debug for FetchPackSizeLimit
Source§impl Default for FetchPackSizeLimit
impl Default for FetchPackSizeLimit
Source§fn default() -> FetchPackSizeLimit
fn default() -> FetchPackSizeLimit
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FetchPackSizeLimit
impl<'de> Deserialize<'de> for FetchPackSizeLimit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FetchPackSizeLimit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FetchPackSizeLimit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FetchPackSizeLimit
impl Display for FetchPackSizeLimit
Source§impl From<ByteSize> for FetchPackSizeLimit
impl From<ByteSize> for FetchPackSizeLimit
Source§fn from(limit: ByteSize) -> FetchPackSizeLimit
fn from(limit: ByteSize) -> FetchPackSizeLimit
Converts to this type from the input type.
Source§impl FromStr for FetchPackSizeLimit
impl FromStr for FetchPackSizeLimit
Source§impl Serialize for FetchPackSizeLimit
impl Serialize for FetchPackSizeLimit
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<String> for FetchPackSizeLimit
impl TryFrom<String> for FetchPackSizeLimit
impl Copy for FetchPackSizeLimit
Auto Trait Implementations§
impl Freeze for FetchPackSizeLimit
impl RefUnwindSafe for FetchPackSizeLimit
impl Send for FetchPackSizeLimit
impl Sync for FetchPackSizeLimit
impl Unpin for FetchPackSizeLimit
impl UnwindSafe for FetchPackSizeLimit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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