Skip to main content

AuthOptions

Struct AuthOptions 

Source
pub(crate) struct AuthOptions<'a> {
    pub(crate) file: Option<&'a str>,
    pub(crate) user: Option<&'a str>,
    pub(crate) explicit: bool,
}

Fields§

§file: Option<&'a str>§user: Option<&'a str>§explicit: bool

Whether either flag was actually given.

Separate from the two options because AuthOptions::file_for fills file in from the layout choir init wrote, and the commands that refuse to take a credential at all — init, join, key, git-credential — must keep asking “did the reader pass one”, not “is there one”.

Implementations§

Source§

impl<'a> AuthOptions<'a>

Source

pub(crate) fn is_empty(self) -> bool

Source

pub(crate) fn file_for(self, api: &str) -> Option<&'a str>

The credential to use when talking to api.

What was given, else the one choir init wrote — so the command that creates a node and the commands that read it agree without a path being typed in between. Before this, every one of them answered 401 on a node the same tool had just set up.

Trait Implementations§

Source§

impl<'a> Clone for AuthOptions<'a>

Source§

fn clone(&self) -> AuthOptions<'a>

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<'a> Copy for AuthOptions<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for AuthOptions<'a>

§

impl<'a> RefUnwindSafe for AuthOptions<'a>

§

impl<'a> Send for AuthOptions<'a>

§

impl<'a> Sync for AuthOptions<'a>

§

impl<'a> Unpin for AuthOptions<'a>

§

impl<'a> UnsafeUnpin for AuthOptions<'a>

§

impl<'a> UnwindSafe for AuthOptions<'a>

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.