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.
A content-addressed cache avoids repeated zstd decompression across instances.
Stale temp directories (older than 1 hour) are cleaned up on construction.
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 once and cached on disk. Subsequent instances on the same host reuse the cache. Stale per-instance directories (older than 1 hour) are cleaned up.
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