Skip to main content

Invocation

Struct Invocation 

Source
pub struct Invocation {
    pub args: Vec<String>,
    pub concurrency: Concurrency,
    pub timeout: Duration,
    pub stdin: Option<Vec<u8>>,
}
Expand description

One invocation of the CLI.

The argument list is a list. It is never joined into a string and never handed to a shell, which is what makes an argument containing a space, a quote or a semicolon uninteresting.

Fields§

§args: Vec<String>§concurrency: Concurrency§timeout: Duration§stdin: Option<Vec<u8>>

Bytes to write to the child’s standard input, for the few commands that read a document rather than a flag.

Implementations§

Source§

impl Invocation

Source

pub fn read<I, S>(args: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

A read: overlaps freely, default timeout.

Source

pub fn mutate<I, S>(args: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

A mutation: queues behind other mutations.

Source

pub fn mutate_shared<I, S>(args: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

A mutation that cannot race the node’s configuration: it changes the filesystem, or a peer, but never what tailscale set and tailscale up contend over.

It runs in the shared lane because the lock exists to keep two configuration writes apart, and these are not that. Queueing them would buy no safety and cost a great deal: a ten-minute file transfer holding the exclusive lock stalls every concurrent read for its whole duration.

Source

pub fn with_timeout(self, timeout: Duration) -> Self

Source

pub fn with_stdin(self, stdin: impl Into<Vec<u8>>) -> Self

Source

pub fn display(&self) -> String

The command as it would be written, for logs and error messages. Never used to run anything.

Trait Implementations§

Source§

impl Clone for Invocation

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for Invocation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.