pub struct CliBackend { /* private fields */ }Expand description
The real backend: finds the binary once, then spawns it per call.
Implementations§
Source§impl CliBackend
impl CliBackend
Sourcepub fn discover() -> Result<Self, ExecError>
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.
Sourcepub fn discover_with(override_path: Option<&OsStr>) -> Result<Self, ExecError>
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.
Sourcepub fn at(binary: impl Into<PathBuf>) -> Self
pub fn at(binary: impl Into<PathBuf>) -> Self
A backend over a known binary. The stub-binary tests use this.
pub fn binary(&self) -> &Path
Trait Implementations§
Source§impl Debug for CliBackend
impl Debug for CliBackend
Source§impl LocalBackend for CliBackend
impl LocalBackend for CliBackend
Auto Trait Implementations§
impl !Freeze for CliBackend
impl !RefUnwindSafe for CliBackend
impl Send for CliBackend
impl Sync for CliBackend
impl Unpin for CliBackend
impl UnsafeUnpin for CliBackend
impl UnwindSafe for CliBackend
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