Skip to main content

Limits

Struct Limits 

Source
pub struct Limits {
    pub max_block_size: u16,
    pub max_length: Option<u64>,
    pub min_length: Option<u64>,
    pub require_definite_length: bool,
    pub allow_start_offset: bool,
    pub available: Option<u64>,
    pub busy: bool,
}
Expand description

What a Responder will agree to.

Every field is a reason §11.22.5.1 gives for rejecting an Init, turned into a number the application sets once instead of a check it has to remember to write.

Fields§

§max_block_size: u16

The largest block this node will handle. The negotiated size is the smaller of this and the Initiator’s proposal.

§max_length: Option<u64>

The largest definite length to accept — LENGTH_TOO_LARGE past it.

§min_length: Option<u64>

The smallest definite length that makes sense here — LENGTH_TOO_SHORT under it.

§require_definite_length: bool

Whether a transfer may proceed without a definite length — LENGTH_REQUIRED if not.

§allow_start_offset: bool

Whether a non-zero start offset is supported — START_OFFSET_NOT_SUPPORTED if not.

§11.22.5.1.3: “Receivers are not required to accept non-zero start offset transfers. Devices SHOULD make every attempt to support non-zero start offset.”

§available: Option<u64>

How much data this node actually has past the start offset, for a Download.

§11.22.5.4.4 is the reason this exists: the accepted length is the proposed one only when the file is that big, and “smaller than the proposed definite length, if the remaining data in the file beyond the Start Offset is smaller than the proposed length”.

§busy: bool

Whether to turn the transfer away with RESPONDER_BUSY. §11.22.5.1: an Initiator “SHOULD wait at least 60 seconds” before trying again.

Trait Implementations§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Limits

Source§

impl Debug for Limits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Limits

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Limits

§

impl Freeze for Limits

§

impl Move for Limits

§

impl RefUnwindSafe for Limits

§

impl Send for Limits

§

impl Sync for Limits

§

impl Unpin for Limits

§

impl UnsafeUnpin for Limits

§

impl UnwindSafe for Limits

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.