pub struct SeqPacket { /* private fields */ }
Available on crate feature l2cap only.
Expand description

An L2CAP sequential packet socket (sequenced, reliable, two-way connection-based data transmission path for datagrams of fixed maximum length).

Implementations

Establish a sequential packet connection with a peer at the specified socket address.

Uses any local Bluetooth adapter.

Gets the peer address of this stream.

Sends a packet.

The packet length must not exceed the Self::send_mtu.

Attempts to send a packet.

The packet length must not exceed the Self::send_mtu.

Receives a packet.

The provided buffer must be of length Self::recv_mtu, otherwise the packet may be truncated.

Attempts to receive a packet.

The provided buffer must be of length Self::recv_mtu, otherwise the packet may be truncated.

Shuts down the read, write, or both halves of this connection.

Maximum transmission unit (MTU) for sending.

Maximum transmission unit (MTU) for receiving.

Constructs a new SeqPacket from the given raw file descriptor.

The file descriptor must have been set to non-blocking mode.

This function consumes ownership of the specified file descriptor. The returned object will take responsibility for closing it when the object goes out of scope.

Safety

If the passed file descriptor is invalid, undefined behavior may occur.

Trait Implementations

Extracts the raw file descriptor. Read more
Converts this type into a shared reference of the (usually inferred) input type.
Formats the value using the given formatter. Read more

Constructs a new instance of Self from the given raw file descriptor.

The file descriptor must have been set to non-blocking mode.

Panics

Panics when the conversion fails. Use SeqPacket::from_raw_fd for a non-panicking variant.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.