pub struct Invocation {
pub command: Option<String>,
pub standard_input: bool,
pub interactive: bool,
}Expand description
How bash was given the code it runs. set refuses -i, -c and -s, so
all three are settled when the shell starts and cannot have changed by the
time anything reads them.
Fields§
§command: Option<String>-c, with the text bash was given. Absent for any other invocation.
standard_input: bool-s: the code arrives on standard input.
interactive: bool-i: bash reads from a terminal, keeps history, and writes main into
BASH_SOURCE for whatever is defined at the prompt.
Implementations§
Source§impl Invocation
impl Invocation
Sourcepub fn from_a_file(&self) -> bool
pub fn from_a_file(&self) -> bool
Whether bash was handed a file to read, which is what makes
Bash::zero a path rather than a word standing in for code bash was
given directly.
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
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 Invocation
impl Debug for Invocation
Source§impl<'de> Deserialize<'de> for Invocation
impl<'de> Deserialize<'de> for Invocation
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
impl Eq for Invocation
Source§impl PartialEq for Invocation
impl PartialEq for Invocation
Source§impl Serialize for Invocation
impl Serialize for Invocation
impl StructuralPartialEq for Invocation
Auto Trait Implementations§
impl Freeze for Invocation
impl RefUnwindSafe for Invocation
impl Send for Invocation
impl Sync for Invocation
impl Unpin for Invocation
impl UnsafeUnpin for Invocation
impl UnwindSafe for Invocation
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.