pub struct Agent {
pub pid: String,
pub socket_path: PathBuf,
pub is_running: bool,
}
Expand description
The SSH agent concept struct.
Fields§
§pid: String
§socket_path: PathBuf
§is_running: bool
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn print_env_commands(&self)
pub fn print_env_commands(&self)
Print the env value exports that would be set by an initialization.
Sourcepub fn kill_and_clean_agent(&mut self)
pub fn kill_and_clean_agent(&mut self)
Kill the agent and ensure the socket paths are cleaned afterwards.
If the agent was alive when this function is called, the ssh-agent
invocation will handle
the path and process clean up. If it was not alive, Agency will attempt to handle these
clean up steps.
Sourcepub fn kill_agent(&mut self)
pub fn kill_agent(&mut self)
Kill the agent via the ssh-agent
tool.
Sourcepub fn check_agent_identities(
&self,
) -> Result<AgentIdentityStatus, Box<dyn Error>>
pub fn check_agent_identities( &self, ) -> Result<AgentIdentityStatus, Box<dyn Error>>
Check the identities present on the agent.
If the agent is not alive, this will return AgentIdentityStatus::ConnectionRefused
.
Trait Implementations§
impl Eq for Agent
impl StructuralPartialEq for Agent
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnwindSafe for Agent
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