Skip to main content

ChanOut

Struct ChanOut 

Source
pub struct ChanOut<'g>(/* private fields */);
Expand description

An output-only SSH channel.

This is used as stderr for a server, or can also be obtained using ChanInOut::split() for cases where a channel’s input should be discarded.

Clone is implemented for convenience, but only one instance each should be read from or written to (this applies to split() instances too). Otherwise ordering will be arbitrary, and if competing readers or writers are in different tasks, there will be churn as they continually wake each other up. Simultaneous single-reader and single-writer is fine.

Implementations§

Source§

impl<'g> ChanOut<'g>

Source

pub fn num(&self) -> ChanNum

Return the channel number.

Source

pub async fn until_closed(&self) -> Result<()>

Wait until the channel closes.

Source

pub async fn term_window_change(&self, winch: WinChange) -> Result<()>

Send a terminal size change notification

Only applicable to client shell channels with a PTY

Trait Implementations§

Source§

impl<'g> Clone for ChanOut<'g>

Source§

fn clone(&self) -> ChanOut<'g>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'g> Debug for ChanOut<'g>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ErrorType for ChanOut<'_>

Source§

type Error = Error

Error type of all the IO operations on this type.
Source§

impl<'g> From<ChanInOut<'g>> for ChanOut<'g>

Source§

fn from(ch: ChanInOut<'g>) -> Self

Converts to this type from the input type.
Source§

impl Write for ChanOut<'_>

Source§

async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Write a buffer into this writer, returning how many bytes were written. Read more
Source§

async fn flush(&mut self) -> Result<()>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Source§

async fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write an entire buffer into this writer. Read more

Auto Trait Implementations§

§

impl<'g> !RefUnwindSafe for ChanOut<'g>

§

impl<'g> !Send for ChanOut<'g>

§

impl<'g> !Sync for ChanOut<'g>

§

impl<'g> !UnwindSafe for ChanOut<'g>

§

impl<'g> Freeze for ChanOut<'g>

§

impl<'g> Unpin for ChanOut<'g>

§

impl<'g> UnsafeUnpin for ChanOut<'g>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.