pub struct Sender<T> { /* private fields */ }Implementations§
Source§impl<T: Serialize + Send + Sync> Sender<T>
impl<T: Serialize + Send + Sync> Sender<T>
Sourcepub async fn new() -> Result<Self>
pub async fn new() -> Result<Self>
Create a new UDP sender bound to an ephemeral port.
§Errors
Returns an error if the socket cannot be bound or connected.
Sourcepub async fn add_subscriber(&self, subscriber: SocketAddr)
pub async fn add_subscriber(&self, subscriber: SocketAddr)
Add a subscriber to the list of subscribers.
§Concurrency
Acquires a write lock on the subscribers list to do this.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Sender<T>
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>where
T: Send,
impl<T> Sync for Sender<T>where
T: Sync,
impl<T> Unpin for Sender<T>where
T: Unpin,
impl<T> UnwindSafe for Sender<T>where
T: 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