pub struct Channel<T>(/* private fields */);
Expand description
A channel for passing messages between fibers. This api is backed by the
tarantool fiber_channel
api which is not awailable in all versions of
tarantool.
Use tarantool::ffi::has_fiber_channel
to check if it is supported in
your case.
If has_fiber_channel
returns false
, using any function from this module
will result in a panic.
Implementations§
Source§impl<T> Channel<T>
impl<T> Channel<T>
Sourcepub unsafe extern "C" fn destroy_msg(msg: *mut ipc_msg)
pub unsafe extern "C" fn destroy_msg(msg: *mut ipc_msg)
§Safety
msg
must have been created with ffi::ipc_value_new
Source§impl<T> Channel<T>
impl<T> Channel<T>
pub fn send(&self, t: T) -> Result<(), T>where
T: 'static,
pub fn send_timeout(&self, t: T, timeout: Duration) -> Result<(), SendError<T>>where
T: 'static,
pub fn try_send(&self, t: T) -> Result<(), TrySendError<T>>where
T: 'static,
pub fn recv(&self) -> Option<T>
pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvError>
pub fn try_recv(&self) -> Result<T, TryRecvError>
Trait Implementations§
Source§impl<'a, T> IntoIterator for &'a Channel<T>
impl<'a, T> IntoIterator for &'a Channel<T>
Source§impl<T> IntoIterator for Channel<T>
impl<T> IntoIterator for Channel<T>
Source§impl<T> RecvTimeout<T> for Channel<T>
impl<T> RecvTimeout<T> for Channel<T>
Source§impl<T> SendTimeout<T> for Channel<T>
impl<T> SendTimeout<T> for Channel<T>
Source§fn send_maybe_timeout(
&self,
t: T,
timeout: Option<Duration>,
) -> Result<(), SendError<T>>where
T: 'static,
fn send_maybe_timeout(
&self,
t: T,
timeout: Option<Duration>,
) -> Result<(), SendError<T>>where
T: 'static,
Send a message
t
over the channel. Read morefn send(&self, t: T) -> Result<(), T>where
T: 'static,
fn send_timeout(&self, t: T, timeout: Duration) -> Result<(), SendError<T>>where
T: 'static,
fn try_send(&self, t: T) -> Result<(), TrySendError<T>>where
T: 'static,
Auto Trait Implementations§
impl<T> Freeze for Channel<T>
impl<T> RefUnwindSafe for Channel<T>where
T: RefUnwindSafe,
impl<T> !Send for Channel<T>
impl<T> !Sync for Channel<T>
impl<T> Unpin for Channel<T>
impl<T> UnwindSafe for Channel<T>where
T: RefUnwindSafe,
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