pub struct OpenSocket<A: PtpAddressFamily> { /* private fields */ }Expand description
A socket not connected to a specific remote.
Can receive and send packets to any valid address of type A.
Implementations§
Source§impl<A: PtpAddressFamily> OpenSocket<A>
impl<A: PtpAddressFamily> OpenSocket<A>
Sourcepub async fn recv(&mut self) -> Result<RecvResult<A>>
pub async fn recv(&mut self) -> Result<RecvResult<A>>
Source§impl<A: PtpAddressFamily> OpenSocket<A>
impl<A: PtpAddressFamily> OpenSocket<A>
Sourcepub async fn send_event(
&self,
buf: &[u8],
from: Option<A>,
to: A,
) -> Result<Option<UniversalTimestamp>>
pub async fn send_event( &self, buf: &[u8], from: Option<A>, to: A, ) -> Result<Option<UniversalTimestamp>>
Send an event message.
Send the event message to the specified remote. If provided, from
sets the sender address for this message, otherwise this is inferred.
Returns the actual time the message was sent if the operating system was able to provide this.
§Errors
Returns any IO errors that occured trying to send the message.
Sourcepub async fn send_general(
&self,
buf: &[u8],
from: Option<A>,
to: A,
) -> Result<()>
pub async fn send_general( &self, buf: &[u8], from: Option<A>, to: A, ) -> Result<()>
Send a general message.
Send the event message to the specified remote. If provided, from
sets the sender address for this message, otherwise this is inferred.
§Errors
Returns any IO errors that occured trying to send the message.
Trait Implementations§
Source§impl<A: PtpAddressFamily> Drop for OpenSocket<A>
impl<A: PtpAddressFamily> Drop for OpenSocket<A>
Auto Trait Implementations§
impl<A> Forget for OpenSocket<A>
impl<A> Freeze for OpenSocket<A>
impl<A> Move for OpenSocket<A>
impl<A> RefUnwindSafe for OpenSocket<A>
impl<A> Send for OpenSocket<A>
impl<A> Sync for OpenSocket<A>
impl<A> Unpin for OpenSocket<A>
impl<A> UnsafeUnpin for OpenSocket<A>
impl<A> UnwindSafe for OpenSocket<A>
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