Skip to main content

ChanIn

Struct ChanIn 

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

An input-only SSH channel.

This is used as stderr for a client.

This must be read, otherwise the SSH session will block. Alternatively drop this ChanIn and incoming data will be discarded.

Clone is implemented for convenience, but only one instance each should be read from. 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> ChanIn<'g>

Source

pub fn num(&self) -> ChanNum

Return the channel number.

Source

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

Wait until the channel closes.

Trait Implementations§

Source§

impl Clone for ChanIn<'_>

Source§

fn clone(&self) -> Self

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 ChanIn<'g>

Source§

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

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

impl Drop for ChanIn<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ErrorType for ChanIn<'_>

Source§

type Error = Error

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

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

Source§

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

Converts to this type from the input type.
Source§

impl Read for ChanIn<'_>

Source§

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

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

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

Read the exact number of bytes required to fill buf. Read more

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'g> Freeze for ChanIn<'g>

§

impl<'g> Unpin for ChanIn<'g>

§

impl<'g> UnsafeUnpin for ChanIn<'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.