pub struct CreditFlowControl {
pub tx_credits: u8,
pub rx_credits: u8,
pub initial_credits: u8,
}Expand description
Credit-based flow control state for an RFCOMM channel
Fields§
§tx_credits: u8Credits granted by remote peer (how many frames we can send)
rx_credits: u8Credits granted to remote peer (how many frames they can send)
initial_credits: u8Initial credits to grant at connection setup
Implementations§
Source§impl CreditFlowControl
impl CreditFlowControl
Sourcepub fn with_initial(initial: u8) -> Self
pub fn with_initial(initial: u8) -> Self
Create with specific initial credits
Sourcepub fn grant_credits(&mut self, count: u8)
pub fn grant_credits(&mut self, count: u8)
Grant additional credits to the remote peer
Sourcepub fn consume_credit(&mut self) -> bool
pub fn consume_credit(&mut self) -> bool
Consume one TX credit (returns false if no credits available)
Sourcepub fn add_tx_credits(&mut self, count: u8)
pub fn add_tx_credits(&mut self, count: u8)
Add TX credits (received from remote peer)
Sourcepub fn needs_replenish(&self) -> bool
pub fn needs_replenish(&self) -> bool
Check if remote peer’s credit is low and needs replenishment
Trait Implementations§
Source§impl Clone for CreditFlowControl
impl Clone for CreditFlowControl
Source§fn clone(&self) -> CreditFlowControl
fn clone(&self) -> CreditFlowControl
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreditFlowControl
impl Debug for CreditFlowControl
Source§impl Default for CreditFlowControl
impl Default for CreditFlowControl
impl Copy for CreditFlowControl
Auto Trait Implementations§
impl Freeze for CreditFlowControl
impl RefUnwindSafe for CreditFlowControl
impl Send for CreditFlowControl
impl Sync for CreditFlowControl
impl Unpin for CreditFlowControl
impl UnwindSafe for CreditFlowControl
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)