pub struct Channel { /* private fields */ }Expand description
An open L2CAP channel.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn adopt(
socket: JObject,
psm: Psm,
peer: String,
sink: Arc<dyn ChannelSink>,
) -> Result<Self, String>
pub fn adopt( socket: JObject, psm: Psm, peer: String, sink: Arc<dyn ChannelSink>, ) -> Result<Self, String>
Take ownership of a connected BluetoothSocket.
Sourcepub fn adopt_accepted(
socket: JObject,
psm: Psm,
sink: Arc<dyn ChannelSink>,
) -> Result<Self, String>
pub fn adopt_accepted( socket: JObject, psm: Psm, sink: Arc<dyn ChannelSink>, ) -> Result<Self, String>
Adopt a socket from BluetoothServerSocket.accept().
Already connected, so unlike Channel::adopt this must not call
connect() — doing so on an accepted socket throws.
pub fn psm(&self) -> Psm
pub fn peer_id(&self) -> &str
pub fn send(&self, bytes: &[u8]) -> Result<(), Closed>
Sourcepub fn pending_bytes(&self) -> usize
pub fn pending_bytes(&self) -> usize
Always zero: writes go straight to the stream, not an internal queue.
pub fn closed(&self) -> Option<Closed>
pub fn close(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Channel
impl Forget for Channel
impl Move for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnsafeUnpin for Channel
impl UnwindSafe for Channel
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