gix_protocol

Struct SendFlushOnDrop

Source
pub struct SendFlushOnDrop<T>
where T: Transport,
{ pub inner: T, /* private fields */ }
Available on crate features blocking-client or async-client only.
Expand description

A utility to automatically send a flush packet when the instance is dropped, assuring a graceful termination of any interaction with the server.

Fields§

§inner: T

The actual transport instance.

Implementations§

Source§

impl<T> SendFlushOnDrop<T>
where T: Transport,

Source

pub fn new(transport: T, trace_packetlines: bool) -> Self

Create a new instance with transport, while optionally tracing packetlines with trace_packetlines.

Source

pub fn indicate_end_of_interaction(&mut self) -> Result<(), Error>

Useful to explicitly invalidate the connection by sending a flush-packet. This will happen exactly once, and it is not considered an error to call it multiple times.

For convenience, this is not consuming, but could be to assure the underlying transport isn’t used anymore.

Trait Implementations§

Source§

impl<T> Drop for SendFlushOnDrop<T>
where T: Transport,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SendFlushOnDrop<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for SendFlushOnDrop<T>
where T: RefUnwindSafe,

§

impl<T> Send for SendFlushOnDrop<T>
where T: Send,

§

impl<T> Sync for SendFlushOnDrop<T>
where T: Sync,

§

impl<T> Unpin for SendFlushOnDrop<T>
where T: Unpin,

§

impl<T> UnwindSafe for SendFlushOnDrop<T>
where T: UnwindSafe,

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> 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, 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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T