Skip to main content

ClientSessionBuilder

Struct ClientSessionBuilder 

Source
pub struct ClientSessionBuilder<L: DataLinkLayer> {
    link: L,
    config: SessionConfig,
    tx_cipher: Option<SecurityContext>,
    rx_cipher: Option<SecurityContext>,
    gbt: Option<GbtConfig>,
}
Expand description

Builder for creating a ClientSession with custom configuration.

Fields§

§link: L§config: SessionConfig§tx_cipher: Option<SecurityContext>§rx_cipher: Option<SecurityContext>§gbt: Option<GbtConfig>

Implementations§

Source§

impl<L: DataLinkLayer> ClientSessionBuilder<L>

Source

pub fn new(link: L) -> Self

Creates a new builder with the given transport link.

Source

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.

Source

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.

Source

pub fn retry_delay(self, delay: Duration) -> Self

Sets the delay between retry attempts.

Source

pub fn with_ciphering(self, tx: SecurityContext, rx: SecurityContext) -> Self

Configures global ciphering for the session.

Source

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.

Source

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.

Source

pub fn gbt_streaming(self, enabled: bool) -> Self

Enables the streaming variant of GBT. Has no effect unless ClientSessionBuilder::with_gbt was called.

Source

pub fn build(self) -> ClientSession<L>

Builds the ClientSession.

Auto Trait Implementations§

§

impl<L> Freeze for ClientSessionBuilder<L>
where L: Freeze,

§

impl<L> RefUnwindSafe for ClientSessionBuilder<L>
where L: RefUnwindSafe,

§

impl<L> Send for ClientSessionBuilder<L>
where L: Send,

§

impl<L> Sync for ClientSessionBuilder<L>
where L: Sync,

§

impl<L> Unpin for ClientSessionBuilder<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for ClientSessionBuilder<L>
where L: UnsafeUnpin,

§

impl<L> UnwindSafe for ClientSessionBuilder<L>
where L: UnwindSafe,

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more