Skip to main content

State

Struct State 

Source
pub struct State {
    pub schema: u32,
    pub machine: String,
    pub accounts: Vec<Account>,
    pub active: Option<String>,
    pub discarded: Vec<String>,
}

Fields§

§schema: u32§machine: String§accounts: Vec<Account>§active: Option<String>§discarded: Vec<String>

Parked items no account refers to any more. Listed in the same save that drops them and removed once deleted, so a delete that fails or is interrupted is retried.

Implementations§

Source§

impl State

Source

pub fn get(&self, label: &str) -> Option<&Account>

Source

pub fn by_uuid(&self, uuid: &str) -> Option<&Account>

Source

pub fn park(&mut self, label: &str, park: Park)

Hold park for the account, discarding whatever it replaces.

Source

pub fn discard(&mut self, service: &str)

Stop holding service and list it for deletion: it has been installed, or it copies a login that is still signed in.

Source

pub fn references(&self, service: &str) -> bool

Source

pub fn upsert(&mut self, account: Account)

Source

pub fn relabel(&mut self, from: &str, to: &str) -> Result<&Account>

Enroll the account under from as to instead. Only the label changes: parked logins are named by account, not by label.

Source

pub fn remove(&mut self, label: &str) -> Option<Account>

Drop the account, listing its park for deletion.

Trait Implementations§

Source§

impl Debug for State

Source§

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

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

impl Default for State

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for State

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for State

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnsafeUnpin for State

§

impl UnwindSafe for State

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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