pub struct SharedData<Buffer, Q, Auxiliary = ()>(/* private fields */);
Expand description

SharedData contains both the writer and the responses because:

  • The overhead of Arc and a separate allocation;
  • If the write end of a connection is closed, then openssh implementation of sftp-server would close the read end right away, discarding any unsent but processed or unprocessed responses.

Implementations§

source§

impl<Buffer, Q, Auxiliary> SharedData<Buffer, Q, Auxiliary>

source

pub fn queue(&self) -> &Q

source

pub fn get_auxiliary(&self) -> &Auxiliary

Returned the auxiliary data.

source§

impl<Buffer: Send + Sync, Q, Auxiliary> SharedData<Buffer, Q, Auxiliary>

source

pub fn create_response_id(&self) -> Id<Buffer>

Create a useable response id.

source

pub fn try_reserve_id(&self, new_id_cnt: u32) -> bool

Return true if reserve succeeds, false otherwise.

source

pub fn reserve_id(&self, new_id_cnt: u32)

Return true if reserve succeeds, false otherwise.

Trait Implementations§

source§

impl<Buffer, Q, Auxiliary> Clone for SharedData<Buffer, Q, Auxiliary>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Buffer: Debug, Q: Debug, Auxiliary: Debug> Debug for SharedData<Buffer, Q, Auxiliary>

source§

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

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

impl<Buffer, Q, Auxiliary> Pointer for SharedData<Buffer, Q, Auxiliary>

source§

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

Formats the value using the given formatter.

Auto Trait Implementations§

§

impl<Buffer, Q, Auxiliary = ()> !RefUnwindSafe for SharedData<Buffer, Q, Auxiliary>

§

impl<Buffer, Q, Auxiliary> Send for SharedData<Buffer, Q, Auxiliary>where Auxiliary: Send + Sync, Buffer: Send, Q: Send + Sync,

§

impl<Buffer, Q, Auxiliary> Sync for SharedData<Buffer, Q, Auxiliary>where Auxiliary: Send + Sync, Buffer: Send, Q: Send + Sync,

§

impl<Buffer, Q, Auxiliary> Unpin for SharedData<Buffer, Q, Auxiliary>

§

impl<Buffer, Q, Auxiliary = ()> !UnwindSafe for SharedData<Buffer, Q, Auxiliary>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.