pub(crate) struct ChannelSender(pub(in core) GcHeap<ChannelSenderInner>);Expand description
The sending half of a channel.
Tuple Fields§
§0: GcHeap<ChannelSenderInner>Implementations§
Source§impl ChannelSender
impl ChannelSender
pub(in core) fn new( channel_id: u64, manager: Arc<ChannelManager>, constant: bool, ) -> Self
Sourcepub(crate) fn send<'ob>(
&self,
obj: Gc<ObjectType<'ob>>,
) -> Result<(), SendError>
pub(crate) fn send<'ob>( &self, obj: Gc<ObjectType<'ob>>, ) -> Result<(), SendError>
Send an object through the channel, blocking if full. Returns Err(SendError::Closed) if the receiver has been dropped.
Sourcepub(crate) fn try_send<'ob>(
&self,
obj: Gc<ObjectType<'ob>>,
) -> Result<(), SendError>
pub(crate) fn try_send<'ob>( &self, obj: Gc<ObjectType<'ob>>, ) -> Result<(), SendError>
Try to send without blocking. Returns Err(SendError::Full) if the channel is full. Returns Err(SendError::Closed) if the receiver has been dropped.
Sourcepub(crate) fn send_timeout<'ob>(
&self,
obj: Gc<ObjectType<'ob>>,
timeout: Duration,
) -> Result<(), SendError>
pub(crate) fn send_timeout<'ob>( &self, obj: Gc<ObjectType<'ob>>, timeout: Duration, ) -> Result<(), SendError>
Send with a timeout. Returns Err(SendError::Timeout) if the timeout expires. Returns Err(SendError::Closed) if the receiver has been dropped.
Trait Implementations§
Source§impl<'new> CloneIn<'new, &'new ChannelSender> for ChannelSender
impl<'new> CloneIn<'new, &'new ChannelSender> for ChannelSender
Source§impl Debug for ChannelSender
impl Debug for ChannelSender
Source§impl Display for ChannelSender
impl Display for ChannelSender
Source§impl<'ob> From<&'ob ChannelSender> for Gc<ObjectType<'ob>>
impl<'ob> From<&'ob ChannelSender> for Gc<ObjectType<'ob>>
Source§fn from(x: &'ob ChannelSender) -> Self
fn from(x: &'ob ChannelSender) -> Self
Converts to this type from the input type.
Source§impl GcMoveable for ChannelSender
impl GcMoveable for ChannelSender
Source§impl IntoObject for ChannelSender
impl IntoObject for ChannelSender
Source§impl PartialEq for ChannelSender
impl PartialEq for ChannelSender
Source§impl TaggedPtr for &ChannelSender
impl TaggedPtr for &ChannelSender
Source§const TAG: Tag = Tag::ChannelSender
const TAG: Tag = Tag::ChannelSender
Tag value. This is only applicable to base values. Use Int for sum
types.
Source§type Ptr = ChannelSender
type Ptr = ChannelSender
The type of object being pointed to. This will be different for all
implementors.
Source§unsafe fn from_obj_ptr(ptr: *const u8) -> Self
unsafe fn from_obj_ptr(ptr: *const u8) -> Self
Given an untyped pointer, reinterpret to self. Read more
Source§unsafe fn tag_ptr(ptr: *const Self::Ptr) -> Gc<Self>
unsafe fn tag_ptr(ptr: *const Self::Ptr) -> Gc<Self>
Given a pointer to
Ptr return a Tagged pointer. Read moreSource§fn untag(val: Gc<Self>) -> Self
fn untag(val: Gc<Self>) -> Self
Remove the tag from the
Gc<T> and return the inner type. If it is
base type then it will only have a single possible value and can be
untagged without checks, but sum types need to create all values
they can hold. We use tagged base types to let us reinterpret bits
without actually modify them. Read moreSource§impl<'old, 'new> WithLifetime<'new> for &'old ChannelSender
impl<'old, 'new> WithLifetime<'new> for &'old ChannelSender
type Out = &'new ChannelSender
unsafe fn with_lifetime(self) -> Self::Out
impl Eq for ChannelSender
impl GcPtr for &ChannelSender
Auto Trait Implementations§
impl !Freeze for ChannelSender
impl !RefUnwindSafe for ChannelSender
impl Send for ChannelSender
impl Sync for ChannelSender
impl Unpin for ChannelSender
impl UnwindSafe for ChannelSender
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.