pub struct P4Cli { /* private fields */ }Expand description
A P4 CLI wrapper that extracts the embedded p4 binary to an isolated temporary directory.
Each P4Cli instance gets its own temp directory, eliminating cross-process races.
The temp directory is cleaned up on Drop.
Implementations§
Source§impl P4Cli
impl P4Cli
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new P4Cli instance.
The embedded p4 binary is decompressed and written to an isolated temporary directory. Each call performs a fresh decompression; there is no persistent cache (see security notes in the crate docs).
Sourcepub fn run<S: AsRef<OsStr>>(&self, args: &[S]) -> Result<P4Output>
pub fn run<S: AsRef<OsStr>>(&self, args: &[S]) -> Result<P4Output>
Convenience method: run p4 with the given arguments.
This is equivalent to self.command().args(args).run().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for P4Cli
impl RefUnwindSafe for P4Cli
impl Send for P4Cli
impl Sync for P4Cli
impl Unpin for P4Cli
impl UnsafeUnpin for P4Cli
impl UnwindSafe for P4Cli
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