pub struct PackedCommand {
pub command: String,
pub stdin: Option<Vec<u8>>,
}Expand description
Packing result: remote command without secret in argv + optional bytes to send on the SSH channel stdin (GAP-SSH-SEC-001).
stdin may hold a password; Drop zeroizes it (memory / RAII rule).
Debug redacts stdin. Prefer moving stdin into run_command (which also
zeroizes after the channel write).
Fields§
§command: StringRemote command line (no embedded password).
stdin: Option<Vec<u8>>Bytes to write on channel stdin (e.g. password + \n for sudo -S / su).
Implementations§
Source§impl PackedCommand
impl PackedCommand
Sourcepub fn take_stdin(&mut self) -> Option<Vec<u8>>
pub fn take_stdin(&mut self) -> Option<Vec<u8>>
Moves stdin out for the channel write; remaining drop is a no-op.
Prefer this over field access: Drop prevents partial moves of stdin.
Trait Implementations§
Source§impl Clone for PackedCommand
impl Clone for PackedCommand
Source§fn clone(&self) -> PackedCommand
fn clone(&self) -> PackedCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackedCommand
impl Debug for PackedCommand
Source§impl Drop for PackedCommand
impl Drop for PackedCommand
Auto Trait Implementations§
impl Freeze for PackedCommand
impl RefUnwindSafe for PackedCommand
impl Send for PackedCommand
impl Sync for PackedCommand
impl Unpin for PackedCommand
impl UnsafeUnpin for PackedCommand
impl UnwindSafe for PackedCommand
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