pub(super) struct SessionInput {
io: Arc<ContainerIO>,
attach: SharedContainerAttach,
client: ClientRx,
pending: Option<Bytes>,
ping: Interval,
pub(super) stdin_open: bool,
}Expand description
Forwards the stdin and the resize events of a client to the process, for the loops of exec and attach sessions, which forward the output meanwhile.
Fields§
§io: Arc<ContainerIO>§attach: SharedContainerAttach§client: ClientRx§pending: Option<Bytes>Stdin which waits for the container.
ping: IntervalPings the client while stdin waits.
stdin_open: boolWhether stdin gets forwarded, until the client closed it.
Implementations§
Source§impl SessionInput
impl SessionInput
Sourcepub(super) fn new(
io: Arc<ContainerIO>,
attach: SharedContainerAttach,
client: ClientRx,
stdin: bool,
) -> Self
pub(super) fn new( io: Arc<ContainerIO>, attach: SharedContainerAttach, client: ClientRx, stdin: bool, ) -> Self
Forward the input of client to the process of io and attach,
stdin only if stdin is set.
Sourcepub(super) async fn next(&mut self) -> InputEvent
pub(super) async fn next(&mut self) -> InputEvent
Forward stdin until the session has something to handle. The session may cancel it for its output, nothing gets lost then.
Sourcepub(super) fn close_container_stdin(&mut self)
pub(super) fn close_container_stdin(&mut self)
Close the stdin of the container after the stdin before. A terminal cannot be closed without ending its output, it gets its end of file character instead, like from a user pressing Ctrl-D. A process reading lines sees the end of its input then, one after a line without its ending needs a second one, like a user would type it.
Sourcepub(super) fn resize_with(
data: &[u8],
resize: impl FnOnce(u16, u16) -> Result<bool>,
)
pub(super) fn resize_with( data: &[u8], resize: impl FnOnce(u16, u16) -> Result<bool>, )
Handle a resize event of the client, its JSON, with resize, which
returns whether there is a terminal. Clients send them regardless of
a terminal, a broken one does not end the session.
fn try_resize( data: &[u8], resize: impl FnOnce(u16, u16) -> Result<bool>, ) -> Result<()>
Auto Trait Implementations§
impl !Freeze for SessionInput
impl !RefUnwindSafe for SessionInput
impl !UnwindSafe for SessionInput
impl Send for SessionInput
impl Sync for SessionInput
impl Unpin for SessionInput
impl UnsafeUnpin for SessionInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].