pub struct ExecManager { /* private fields */ }Expand description
Exec manager.
Implementations§
Source§impl ExecManager
impl ExecManager
Sourcepub fn with_agent(agent: Arc<dyn ExecAgentConnection>) -> Self
pub fn with_agent(agent: Arc<dyn ExecAgentConnection>) -> Self
Creates a new exec manager with an agent connection.
Sourcepub fn set_agent(&mut self, agent: Arc<dyn ExecAgentConnection>)
pub fn set_agent(&mut self, agent: Arc<dyn ExecAgentConnection>)
Sets the agent connection.
Sourcepub fn create(&self, config: ExecConfig) -> Result<ExecId>
pub fn create(&self, config: ExecConfig) -> Result<ExecId>
Creates a new exec instance.
§Errors
Returns ContainerError::LockPoisoned if the internal lock is poisoned.
Sourcepub fn get(&self, id: &ExecId) -> Option<ExecInstance>
pub fn get(&self, id: &ExecId) -> Option<ExecInstance>
Gets an exec instance by ID.
Sourcepub async fn start(
&self,
id: &ExecId,
detach: bool,
tty_width: u32,
tty_height: u32,
) -> Result<ExecStartResult>
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 IDdetach- If true, run in background and return immediatelytty_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.
Sourcepub async fn resize(&self, id: &ExecId, width: u32, height: u32) -> Result<()>
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.
Sourcepub fn notify_exit(&self, id: &ExecId, exit_code: i32)
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.
Sourcepub fn list_for_container(
&self,
container_id: &ContainerId,
) -> Vec<ExecInstance>
pub fn list_for_container( &self, container_id: &ContainerId, ) -> Vec<ExecInstance>
Lists all exec instances for a container.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ExecManager
impl !RefUnwindSafe for ExecManager
impl Send for ExecManager
impl Sync for ExecManager
impl Unpin for ExecManager
impl UnsafeUnpin for ExecManager
impl !UnwindSafe for ExecManager
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
Mutably borrows from an owned value. Read more