fn send(&mut self, value: T) -> Result<(), ChannelSendError<T>> {
        if self.is_fulfilled {
            return Err(ChannelSendError(value));
        }

        self.value = Some(value);
        self.is_fulfilled = true;

        // Wakeup all waiters
        let waiters = self.waiters.take();
        // Safety: The linked list is guaranteed to be only manipulated inside
        // the mutex in scope of the ChannelState and is thereby guaranteed to
        // be consistent.
        unsafe {
            wake_waiters(waiters);
        }

        Ok(())
    }
/// Writes a single value to the channel.
/// If a value had been written to the channel before, the new value will be rejected.
Writes a single value to the channel.
If a value had been written to the channel before, the new value will be rejected.
Writes a single value to the channel . If a value had been written to the channel before the new value will be rejected .
fn send(&mut self, value: T) -> Result<(), ChannelSendError<T>> {
        if self.is_fulfilled {
            return Err(ChannelSendError(value));
        }
        self.value = Some(value);
        self.is_fulfilled = true;
        // Wakeup all waiters
        let waiters = self.waiters.take();
        // Safety: The linked list is guaranteed to be only manipulated inside
        // the mutex in scope of the ChannelState and is thereby guaranteed to
        // be consistent.
        unsafe {
            wake_waiters(waiters);
        }
        Ok(())
    }
fn send ( & mut self , value : T ) -> Result < ( ) , ChannelSendError < T > > { if self . is_fulfilled { return Err ( ChannelSendError ( value ) ) ; } self . value = Some ( value ) ; self . is_fulfilled = true ; // Wakeup all waiters let waiters = self . waiters . take ( ) ; // Safety: The linked list is guaranteed to be only manipulated inside // the mutex in scope of the ChannelState and is thereby guaranteed to // be consistent. unsafe { wake_waiters ( waiters ) ; } Ok ( ( ) ) }
Writes a single value to the channel.
Writes a single value to the channel .
&mut self
value
T
&mut self
value
T