pub struct ExchangePolicy {
pub report_id: u8,
pub response_wait: Duration,
pub busy_handling: BusyHandling,
pub busy_retries: u8,
pub busy_retry_wait: Duration,
pub validate_transaction_id: bool,
pub validate_remaining_packets: bool,
}Expand description
Per-connection rules for one classic feature-report exchange.
每个连接上一次经典功能报文交换所用的规则。
Fields§
§report_id: u8§response_wait: Duration§busy_handling: BusyHandling§busy_retries: u8§busy_retry_wait: Duration§validate_transaction_id: bool§validate_remaining_packets: boolImplementations§
Source§impl ExchangePolicy
impl ExchangePolicy
Sourcepub const fn new(report_id: u8, response_wait: Duration) -> Self
pub const fn new(report_id: u8, response_wait: Duration) -> Self
Construct a conservative policy that accepts, but does not resend, a valid busy response. Callers must provide their device’s response delay.
构造保守策略:接受有效忙碌响应而不重发。调用者必须指定设备的响应等待时间。
Sourcepub const fn with_busy_retry(self, retries: u8, wait: Duration) -> Self
pub const fn with_busy_retry(self, retries: u8, wait: Duration) -> Self
Opt into resending a busy command. Use only for operations known to be safe to repeat on the selected device and firmware.
显式允许重发忙碌命令;仅适用于已确认在该设备与固件上可安全重复的操作。
pub const fn with_transaction_validation(self, enabled: bool) -> Self
pub const fn with_remaining_packets_validation(self, enabled: bool) -> Self
Trait Implementations§
Source§impl Clone for ExchangePolicy
impl Clone for ExchangePolicy
Source§fn clone(&self) -> ExchangePolicy
fn clone(&self) -> ExchangePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ExchangePolicy
Source§impl Debug for ExchangePolicy
impl Debug for ExchangePolicy
impl Eq for ExchangePolicy
Source§impl PartialEq for ExchangePolicy
impl PartialEq for ExchangePolicy
Source§fn eq(&self, other: &ExchangePolicy) -> bool
fn eq(&self, other: &ExchangePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ExchangePolicy
Auto Trait Implementations§
impl Freeze for ExchangePolicy
impl RefUnwindSafe for ExchangePolicy
impl Send for ExchangePolicy
impl Sync for ExchangePolicy
impl Unpin for ExchangePolicy
impl UnsafeUnpin for ExchangePolicy
impl UnwindSafe for ExchangePolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more