pub struct Parameters {
pub control: TransferControl,
pub max_block_size: u16,
pub start_offset: u64,
pub length: Option<u64>,
}Expand description
The parameters both ends settled on: what the Accept message says, in one value.
Fields§
§control: TransferControlThe chosen version and the one chosen drive mode.
max_block_size: u16The Max Block Size in force. A block may be shorter; none may be longer.
start_offset: u64Where in the file the transfer starts.
length: Option<u64>The number of octets that will be transferred, when it is known in advance. None is
§11.22.5.1.5’s indefinite length, and turns off the end-of-transfer length check.
Implementations§
Source§impl Parameters
impl Parameters
Sourcepub const fn sender_drives(&self) -> bool
pub const fn sender_drives(&self) -> bool
Whether the Sender paces the transfer (TC[SENDER_DRIVE]).
Sourcepub const fn receiver_drives(&self) -> bool
pub const fn receiver_drives(&self) -> bool
Whether the Receiver paces it with BlockQuery messages (TC[RECEIVER_DRIVE]).
Sourcepub const fn send_accept<'a>(&self, metadata: &'a [u8]) -> SendAccept<'a>
pub const fn send_accept<'a>(&self, metadata: &'a [u8]) -> SendAccept<'a>
The SendAccept that carries these parameters (§11.22.5.2).
Sourcepub const fn receive_accept<'a>(&self, metadata: &'a [u8]) -> ReceiveAccept<'a>
pub const fn receive_accept<'a>(&self, metadata: &'a [u8]) -> ReceiveAccept<'a>
The ReceiveAccept that carries these parameters (§11.22.5.3).
Sourcepub fn from_send_accept(
proposed: &Init<'_>,
accept: &SendAccept<'_>,
) -> Rejected<Self>
pub fn from_send_accept( proposed: &Init<'_>, accept: &SendAccept<'_>, ) -> Rejected<Self>
Checks a Responder’s SendAccept against what was proposed, for an upload.
§11.22.5.1: “The parameters in the SendAccept/ReceiveAccept message SHALL be used in the transfer. If those parameters are unacceptable to the Initiator, it SHALL abort the transfer with an appropriate error.”
Sourcepub fn from_receive_accept(
proposed: &Init<'_>,
accept: &ReceiveAccept<'_>,
) -> Rejected<Self>
pub fn from_receive_accept( proposed: &Init<'_>, accept: &ReceiveAccept<'_>, ) -> Rejected<Self>
Checks a Responder’s ReceiveAccept against what was proposed, for a download.