Skip to main content

ExecManager

Struct ExecManager 

Source
pub struct ExecManager { /* private fields */ }
Expand description

Exec manager.

Implementations§

Source§

impl ExecManager

Source

pub fn new() -> Self

Creates a new exec manager.

Source

pub fn with_agent(agent: Arc<dyn ExecAgentConnection>) -> Self

Creates a new exec manager with an agent connection.

Source

pub fn set_agent(&mut self, agent: Arc<dyn ExecAgentConnection>)

Sets the agent connection.

Source

pub fn create(&self, config: ExecConfig) -> Result<ExecId>

Creates a new exec instance.

§Errors

Returns ContainerError::LockPoisoned if the internal lock is poisoned.

Source

pub fn get(&self, id: &ExecId) -> Option<ExecInstance>

Gets an exec instance by ID.

Source

pub async fn start( &self, id: &ExecId, detach: bool, tty_width: u32, tty_height: u32, ) -> Result<ExecStartResult>

Starts an exec instance.

Sends an ExecStartRequest to the agent and waits for completion. If detach=true, returns immediately after the process starts.

§Arguments
  • id - The exec instance ID
  • detach - If true, run in background and return immediately
  • tty_width - Initial TTY width (if TTY mode)
  • tty_height - Initial TTY height (if TTY mode)
§Errors

Returns an error if the exec cannot be started.

Source

pub async fn resize(&self, id: &ExecId, width: u32, height: u32) -> Result<()>

Resizes the exec TTY.

Sends a resize request to the agent to update the PTY window size.

§Errors

Returns an error if the resize fails.

Source

pub fn notify_exit(&self, id: &ExecId, exit_code: i32)

Marks an exec instance as completed.

Called when the agent notifies that an exec process has exited.

Source

pub fn list_for_container( &self, container_id: &ContainerId, ) -> Vec<ExecInstance>

Lists all exec instances for a container.

Trait Implementations§

Source§

impl Default for ExecManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.