pub struct CommandRequest { /* private fields */ }Expand description
Bounded exec-style command request with no shell interpretation.
Implementations§
Source§impl CommandRequest
impl CommandRequest
Sourcepub fn new<I, S>(
program: impl Into<String>,
args: I,
deadline: Timestamp,
) -> Result<Self, RequestError>
pub fn new<I, S>( program: impl Into<String>, args: I, deadline: Timestamp, ) -> Result<Self, RequestError>
Creates and validates an exec-style request.
Sourcepub fn with_working_dir(
self,
working_dir: impl Into<PathBuf>,
) -> Result<Self, RequestError>
pub fn with_working_dir( self, working_dir: impl Into<PathBuf>, ) -> Result<Self, RequestError>
Sets an absolute normalized working directory.
Sourcepub fn with_stdin(self, stdin: Vec<u8>) -> Result<Self, RequestError>
pub fn with_stdin(self, stdin: Vec<u8>) -> Result<Self, RequestError>
Sets bounded stdin bytes delivered without shell interpretation.
Sourcepub fn with_output_limits(
self,
stdout_bytes: usize,
stderr_bytes: usize,
) -> Result<Self, RequestError>
pub fn with_output_limits( self, stdout_bytes: usize, stderr_bytes: usize, ) -> Result<Self, RequestError>
Sets bounded stdout and stderr budgets.
Sourcepub fn validate_at(&self, now: Timestamp) -> Result<(), RequestError>
pub fn validate_at(&self, now: Timestamp) -> Result<(), RequestError>
Rejects a request whose deadline has already elapsed.
Sourcepub fn working_dir(&self) -> Option<&Path>
pub fn working_dir(&self) -> Option<&Path>
Returns the optional absolute working directory.
Sourcepub const fn max_stdout_bytes(&self) -> usize
pub const fn max_stdout_bytes(&self) -> usize
Returns the maximum captured stdout bytes.
Sourcepub const fn max_stderr_bytes(&self) -> usize
pub const fn max_stderr_bytes(&self) -> usize
Returns the maximum captured stderr bytes.
Trait Implementations§
Source§impl Clone for CommandRequest
impl Clone for CommandRequest
Source§fn clone(&self) -> CommandRequest
fn clone(&self) -> CommandRequest
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 CommandRequest
impl Debug for CommandRequest
Source§impl<'de> Deserialize<'de> for CommandRequest
impl<'de> Deserialize<'de> for CommandRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandRequest
impl PartialEq for CommandRequest
Source§fn eq(&self, other: &CommandRequest) -> bool
fn eq(&self, other: &CommandRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CommandRequest
impl Serialize for CommandRequest
impl Eq for CommandRequest
impl StructuralPartialEq for CommandRequest
Auto Trait Implementations§
impl Freeze for CommandRequest
impl RefUnwindSafe for CommandRequest
impl Send for CommandRequest
impl Sync for CommandRequest
impl Unpin for CommandRequest
impl UnsafeUnpin for CommandRequest
impl UnwindSafe for CommandRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.