pub struct ClientSessionBuilder<L: DataLinkLayer> { /* private fields */ }Expand description
Builder for creating a ClientSession with custom configuration.
Implementations§
Source§impl<L: DataLinkLayer> ClientSessionBuilder<L>
impl<L: DataLinkLayer> ClientSessionBuilder<L>
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Sets the request timeout. If a response is not received within this
duration, the request is retried (if retries are configured) or
a SessionError::Timeout error is returned.
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
Sets the maximum number of retry attempts for transient errors (I/O errors, unexpected APDUs). Set to 0 for no retries.
Sourcepub fn retry_delay(self, delay: Duration) -> Self
pub fn retry_delay(self, delay: Duration) -> Self
Sets the delay between retry attempts.
Sourcepub fn with_ciphering(self, tx: SecurityContext, rx: SecurityContext) -> Self
pub fn with_ciphering(self, tx: SecurityContext, rx: SecurityContext) -> Self
Configures global ciphering for the session.
Sourcepub fn with_gbt(self, block_size: usize) -> Self
pub fn with_gbt(self, block_size: usize) -> Self
Enables general block transfer (IEC 62056-5-3 §9.3) for requests and
responses whose service qualifies (see gbt::applies_to_apdu) and
exceed block_size octets: they are segmented into GBT blocks instead
of sent as a single frame. Unconfirmed by default (no ack between
blocks); see ClientSessionBuilder::gbt_window for confirmed mode.
Sourcepub fn gbt_window(self, window: u8) -> Self
pub fn gbt_window(self, window: u8) -> Self
Sets the confirmed-mode window size for GBT (0 = unconfirmed).
Has no effect unless ClientSessionBuilder::with_gbt was called.
Sourcepub fn gbt_streaming(self, enabled: bool) -> Self
pub fn gbt_streaming(self, enabled: bool) -> Self
Enables the streaming variant of GBT. Has no effect unless
ClientSessionBuilder::with_gbt was called.
Sourcepub fn build(self) -> ClientSession<L>
pub fn build(self) -> ClientSession<L>
Builds the ClientSession.