pub struct TransferBudget { /* private fields */ }Expand description
Compose once at the handle’s root and pass to every connection and file owner. Existing response bodies retain their leases when a limit changes.
Implementations§
Source§impl TransferBudget
impl TransferBudget
Sourcepub fn new(limits: TransferLimits) -> Self
pub fn new(limits: TransferLimits) -> Self
An unused budget with the app’s configured limits.
Sourcepub fn limits(&self) -> TransferLimits
pub fn limits(&self) -> TransferLimits
The current limits; the next upload to start checks the upload limit.
Sourcepub fn set_limits(&self, limits: TransferLimits)
pub fn set_limits(&self, limits: TransferLimits)
Change admission for subsequent downloads without cancelling an active response. Reducing the limit waits for enough existing bodies to end.
Auto Trait Implementations§
impl !Freeze for TransferBudget
impl RefUnwindSafe for TransferBudget
impl Send for TransferBudget
impl Sync for TransferBudget
impl Unpin for TransferBudget
impl UnsafeUnpin for TransferBudget
impl UnwindSafe for TransferBudget
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
§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 moreCreates a shared type from an unshared type.