Function splitrc::new

source ·
pub fn new<T: Notify>(data: T) -> (Tx<T>, Rx<T>)
Expand description

Allocates a pointer holding data and returns a pair of references.

T must implement Notify to receive a notification when the write half or read half are dropped.

data is dropped when both halves’ reference counts reach zero.