Skip to main content

CliBackend

Struct CliBackend 

Source
pub struct CliBackend { /* private fields */ }
Expand description

The real backend: finds the binary once, then spawns it per call.

Implementations§

Source§

impl CliBackend

Source

pub fn discover() -> Result<Self, ExecError>

Find the binary and build a backend around it.

Order: the explicit override, then the search path, then the shim the macOS applications install, and last the executable inside the application bundle. The override is first because an operator who names a path means it — if it is wrong, that is an error rather than a quiet fallback to some other Tailscale on the machine. The bundle is last because it is the only candidate that can be present and not be a command-line interface; bundle_candidates says why.

Source

pub fn discover_with(override_path: Option<&OsStr>) -> Result<Self, ExecError>

Self::discover, with the override supplied rather than read from the environment, so a test can drive every branch.

Source

pub fn at(binary: impl Into<PathBuf>) -> Self

A backend over a known binary. The stub-binary tests use this.

Source

pub fn binary(&self) -> &Path

Trait Implementations§

Source§

impl Debug for CliBackend

Source§

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

Formats the value using the given formatter. Read more
Source§

impl LocalBackend for CliBackend

Source§

fn run<'a>( &'a self, invocation: Invocation, ) -> BoxFuture<'a, Result<Output, ExecError>>

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> 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, 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.