Skip to main content

ForeignService

Struct ForeignService 

Source
pub struct ForeignService {
    pub directories: ServiceDirectories,
    pub root: PathBuf,
    pub owner: Option<String>,
    pub this_account: Option<String>,
    pub local_root: PathBuf,
    pub local_record: PathBuf,
    pub unused_local_record: Option<InstallRecord>,
    pub unreadable: Option<String>,
}
Expand description

A registration whose command line names application-data directories that are not this account’s: another installation’s service.

Every account on a machine sees the one registration its service manager holds under the product’s name. A second account – one that ran a login-mode install once, say – has an install record and a database of its own, and comparing them against the other installation’s registration used to report a stale binary, a mismatched start mode and a secret store in the wrong scope, with service uninstall, service install and auth login as the remedies. Followed from that account, each of them breaks or replaces a service that is healthy. So the registration is reported as the other installation’s, with what can be read of it, and this account’s own record as the unused configuration it is.

Fields§

§directories: ServiceDirectories

The directories its command line names.

§root: PathBuf

The data root they sit under. See ServiceDirectories::root.

§owner: Option<String>

The account that data root belongs to, when its path says.

§this_account: Option<String>

How a command run by this account reaches the installation, when it is this account’s own under other directories – an install made with --data-dir, seen from a command run without it, or the other way round. None for another account’s.

§local_root: PathBuf

This account’s own data root, which no registration runs against.

§local_record: PathBuf

Where this account’s own install record is, or would be.

§unused_local_record: Option<InstallRecord>

This account’s own install record, from an earlier install.

§unreadable: Option<String>

Why the service’s own records could not be read, or None when they were and the status describes them.

Implementations§

Source§

impl ForeignService

Source

pub fn where_to_look(&self) -> String

How to see the service’s own details: as its owner, or elevated.

Source

pub fn act_as(&self) -> String

Where a change to the service has to be made from: the installation’s own account, because every remedy a command prints acts on the directories of whoever runs it. Elevation alone reads the service’s records but is still this account.

Source

pub const fn is_unread(&self) -> bool

Whether the service’s own records could not be read, so only what the service manager says is known.

Source

pub fn installed_by(&self) -> String

Who installed it, for a sentence.

Source

pub fn label(&self) -> String

The data root and its owner, for a field: <root> (<owner>).

Source

pub fn unused_local_note(&self) -> Option<String>

The note describing this account’s own record, when there is one.

Trait Implementations§

Source§

impl Clone for ForeignService

Source§

fn clone(&self) -> Self

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 ForeignService

Source§

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

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

impl Eq for ForeignService

Source§

impl PartialEq for ForeignService

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ForeignService

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more