use super::*;
impl<T: TransportPort + 'static> ClientBuilder<T> {
pub fn apdu_retries(mut self, retries: u8) -> Self {
self.config.apdu_retries = retries;
self
}
pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
self.config.max_segments = max_segments;
self
}
pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
self.config.segmented_response_accepted = accepted;
self
}
pub fn proposed_window_size(mut self, window_size: u8) -> Self {
self.config.proposed_window_size = window_size;
self
}
pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
where
F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
{
self.options = self
.options
.with_confirmed_cov_notification_ack_policy(policy);
self
}
}
impl BipClientBuilder {
pub fn apdu_retries(mut self, retries: u8) -> Self {
self.config.apdu_retries = retries;
self
}
pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
self.config.max_segments = max_segments;
self
}
pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
self.config.segmented_response_accepted = accepted;
self
}
pub fn proposed_window_size(mut self, window_size: u8) -> Self {
self.config.proposed_window_size = window_size;
self
}
pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
where
F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
{
self.options = self
.options
.with_confirmed_cov_notification_ack_policy(policy);
self
}
}
#[cfg(feature = "ipv6")]
impl Bip6ClientBuilder {
pub fn apdu_retries(mut self, retries: u8) -> Self {
self.config.apdu_retries = retries;
self
}
pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
self.config.max_segments = max_segments;
self
}
pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
self.config.segmented_response_accepted = accepted;
self
}
pub fn proposed_window_size(mut self, window_size: u8) -> Self {
self.config.proposed_window_size = window_size;
self
}
pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
where
F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
{
self.options = self
.options
.with_confirmed_cov_notification_ack_policy(policy);
self
}
}
#[cfg(feature = "sc-tls")]
impl ScClientBuilder {
pub fn apdu_retries(mut self, retries: u8) -> Self {
self.config.apdu_retries = retries;
self
}
pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
self.config.max_segments = max_segments;
self
}
pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
self.config.segmented_response_accepted = accepted;
self
}
pub fn proposed_window_size(mut self, window_size: u8) -> Self {
self.config.proposed_window_size = window_size;
self
}
pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
where
F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
{
self.options = self
.options
.with_confirmed_cov_notification_ack_policy(policy);
self
}
}