W3cubDocs

/Rust

Struct std::sync::mpsc::SyncSender

pub struct SyncSender<T> { /* fields omitted */ }

The sending-half of Rust's synchronous channel type. This half can only be owned by one thread, but it can be cloned to send to other threads.

Methods

impl<T> SyncSender<T> [src]

Sends a value on this synchronous channel.

This function will block until space in the internal buffer becomes available or a receiver is available to hand off the message to.

Note that a successful send does not guarantee that the receiver will ever see the data if there is a buffer on this channel. Items may be enqueued in the internal buffer for the receiver to receive at a later time. If the buffer size is 0, however, it can be guaranteed that the receiver has indeed received the data if this function returns success.

This function will never panic, but it may return Err if the Receiver has disconnected and is no longer able to receive information.

Attempts to send a value on this channel without blocking.

This method differs from send by returning immediately if the channel's buffer is full or no receiver is waiting to acquire some data. Compared with send, this function has two failure cases instead of one (one for disconnection, one for a full buffer).

See SyncSender::send for notes about guarantees of whether the receiver has received the data or not if this function is successful.

Trait Implementations

impl<T: Send> Send for SyncSender<T> [src]

impl<T> !Sync for SyncSender<T> [src]

impl<T> Clone for SyncSender<T> [src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Drop for SyncSender<T> [src]

A method called when the value goes out of scope. Read more

impl<T> Debug for SyncSender<T>
1.7.0
[src]

Formats the value using the given formatter.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/sync/mpsc/struct.SyncSender.html