pub struct L2capChannel<C: PlatformChannel> { /* private fields */ }Expand description
An open L2CAP channel. Closes on drop.
Implementations§
Source§impl<C: PlatformChannel> L2capChannel<C>
impl<C: PlatformChannel> L2capChannel<C>
Sourcepub fn new(channel: C, sink: Arc<Sink>, incoming: Incoming) -> Self
pub fn new(channel: C, sink: Arc<Sink>, incoming: Incoming) -> Self
Wrap a platform socket that was opened with sink’s first value.
Sourcepub fn take_incoming(&self) -> Option<Incoming>
pub fn take_incoming(&self) -> Option<Incoming>
Take the inbound byte stream. None on a second call — there is one
stream and consuming it twice would split the bytes between consumers.
Sourcepub fn send(&self, bytes: &[u8]) -> Result<()>
pub fn send(&self, bytes: &[u8]) -> Result<()>
Queue bytes for sending.
Returns once queued, not once on the air; the pump writes them as the
peer grants credit. Use L2capChannel::flushed to wait for the queue
to drain.
Sourcepub fn pending_bytes(&self) -> usize
pub fn pending_bytes(&self) -> usize
How many queued bytes have not been written yet.
Trait Implementations§
Auto Trait Implementations§
impl<C> !Freeze for L2capChannel<C>
impl<C> Forget for L2capChannel<C>
impl<C> Move for L2capChannel<C>
impl<C> RefUnwindSafe for L2capChannel<C>where
C: RefUnwindSafe,
impl<C> Send for L2capChannel<C>
impl<C> Sync for L2capChannel<C>
impl<C> Unpin for L2capChannel<C>where
C: Unpin,
impl<C> UnsafeUnpin for L2capChannel<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for L2capChannel<C>where
C: UnwindSafe,
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