pub struct TransferControl {
pub version: u8,
pub sender_drive: bool,
pub receiver_drive: bool,
pub asynchronous: bool,
}Expand description
The Transfer Control octet: a version and the transfer modes (§11.22.5.1.1, §11.22.5.4.1).
The same octet is PTC in an Init, where the bits are everything the Initiator can do,
and TC in an Accept, where exactly one drive bit is what the Responder chose.
Fields§
§version: u8[VERSION], the low four bits.
sender_drive: bool[SENDER_DRIVE]: the Sender paces the transfer with Block messages.
receiver_drive: bool[RECEIVER_DRIVE]: the Receiver paces it with BlockQuery messages.
asynchronous: bool[ASYNC]: no driver, flow control left to the transport.
Provisional in 1.6, and §11.22.5.4.1 is explicit that a Responder “SHALL not” choose it
— so negotiate never does.
Implementations§
Source§impl TransferControl
impl TransferControl
Sourcepub const fn proposal() -> Self
pub const fn proposal() -> Self
Proposes synchronous Sender drive and Receiver drive at VERSION, which is what an
initiator that can do either should offer (§11.22.5.1.1).
Sourcepub const fn from_u8(value: u8) -> Self
pub const fn from_u8(value: u8) -> Self
Reads the octet.
Bit 7 is RFU and is ignored rather than refused: the version field is how BDX makes a breaking change, so a spare bit in a message a future version sends is not this version’s business.
Sourcepub const fn is_decided(self) -> bool
pub const fn is_decided(self) -> bool
Whether exactly one drive mode is named, which is what an Accept must carry.
§11.22.5.4.1: “exactly one mode SHALL be chosen for this transfer”, and the two bits are mutually exclusive — “if this is set, TC[RECEIVER_DRIVE] SHALL be 0”.