pub(crate) struct Terminal {
path: TempFile,
connected_rx: Receiver<OwnedFd>,
resizer: TerminalResizer,
}Expand description
The terminal of a process, which the runtime passes over a console socket.
Fields§
§path: TempFileThe socket the runtime connects to, removed with the terminal.
connected_rx: Receiver<OwnedFd>§resizer: TerminalResizerImplementations§
Source§impl Terminal
impl Terminal
Sourcepub(crate) fn resizer(&self) -> TerminalResizer
pub(crate) fn resizer(&self) -> TerminalResizer
Resizes the terminal also while something else holds it, like the runtime call which waits for the connection.
Sourcefn tty(&self) -> Option<Arc<TerminalFd>>
fn tty(&self) -> Option<Arc<TerminalFd>>
The terminal while it is connected and open.
Source§impl Terminal
impl Terminal
Sourcepub(crate) async fn connect(&mut self) -> Result<TerminalIo>
pub(crate) async fn connect(&mut self) -> Result<TerminalIo>
Wait for the runtime to hand over the terminal, for the loops which
read and write it, see
ContainerIO::connect_terminal.
A wait which gets dropped leaves the descriptor queued for the next
one. The terminal gets the size requested before, see
TerminalResizer::resize.
Sourcepub(crate) fn eof_char(&self) -> u8
pub(crate) fn eof_char(&self) -> u8
The end of file character of the terminal, ^D unless the process changed it.
Sourcepub(crate) fn resize(&self, width: u16, height: u16) -> Result<()>
pub(crate) fn resize(&self, width: u16, height: u16) -> Result<()>
Resize the terminal width and height, see TerminalResizer::resize.
Sourceasync fn listen(listener: UnixListener, config: Config) -> Result<()>
async fn listen(listener: UnixListener, config: Config) -> Result<()>
Accept the connection of the runtime and receive the terminal from it. The runtime never connects or never sends the descriptor if it fails early. The terminal gets dropped then, which closes the channel, so do not keep the listener around forever.
async fn accept(listener: UnixListener, config: Config) -> Result<()>
async fn handle_fd_receive(stream: UnixStream, config: Config) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Terminal
impl RefUnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl UnsafeUnpin for Terminal
impl UnwindSafe for Terminal
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].