pub struct PreparedWSLCommand<'a> { /* private fields */ }Expand description
The PreparedWSLCommand struct represents a command that has been prepared for execution within the WSL environment and can be reused without re-encoding.
A command pre-encoded for the WSL Plugin API.
PreparedWSLCommand stores:
- a NUL-terminated program path (
c_path), - a NUL-terminated
argvpointer array (argv), - owned C strings backing
argv(_c_args).
This avoids rebuilding C-compatible buffers when executing the same command multiple times.
Instances are usually created from WSLCommand via WSLCommand::prepare
or From<WSLCommand>.
Trait Implementations§
Source§impl<'a> Debug for PreparedWSLCommand<'a>
impl<'a> Debug for PreparedWSLCommand<'a>
Source§impl<'a> From<&WSLCommand<'a>> for PreparedWSLCommand<'a>
impl<'a> From<&WSLCommand<'a>> for PreparedWSLCommand<'a>
Source§fn from(value: &WSLCommand<'a>) -> Self
fn from(value: &WSLCommand<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<WSLCommand<'a>> for PreparedWSLCommand<'a>
impl<'a> From<WSLCommand<'a>> for PreparedWSLCommand<'a>
Source§fn from(value: WSLCommand<'a>) -> Self
fn from(value: WSLCommand<'a>) -> Self
Converts to this type from the input type.
Source§impl WSLCommandExecution for PreparedWSLCommand<'_>
impl WSLCommandExecution for PreparedWSLCommand<'_>
Source§fn execute(&self) -> ApiResult<TcpStream>
fn execute(&self) -> ApiResult<TcpStream>
Executes the prepared command via the underlying WSL Plugin API.
§Behavior
DistributionID::SystemusesExecuteBinary.DistributionID::UserusesExecuteBinaryInDistribution.
§Errors
Returns an API error if the call fails, including version requirements for distribution-scoped execution.
Auto Trait Implementations§
impl<'a> Freeze for PreparedWSLCommand<'a>
impl<'a> RefUnwindSafe for PreparedWSLCommand<'a>
impl<'a> !Send for PreparedWSLCommand<'a>
impl<'a> !Sync for PreparedWSLCommand<'a>
impl<'a> Unpin for PreparedWSLCommand<'a>
impl<'a> UnsafeUnpin for PreparedWSLCommand<'a>
impl<'a> UnwindSafe for PreparedWSLCommand<'a>
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