Skip to content
Snippets Groups Projects
Commit 0882f531 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

doc: mailbox clone

parent 53ab71d5
No related branches found
No related tags found
1 merge request!266Minor fixes
Pipeline #12339 passed
......@@ -57,6 +57,17 @@ struct Inner<T> {
}
impl<T> Clone for Mailbox<T> {
/// Shares access to the existing mailbox, thereby enabling
/// inter-fiber communication. The conent itself isn't cloned.
///
/// # Example
/// ```
/// let original: Mailbox<i32> = Mailbox::new();
/// let cloned: Mailbox<i32> = original.clone();
/// cloned.send(55);
/// assert_eq!(original.try_receive_all(), vec![55]);
/// ```
///
fn clone(&self) -> Self {
Self(self.0.clone())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment