Skip to main content

Credentials

Struct Credentials 

Source
pub struct Credentials {
    pub apple_id: AppleId,
    /* private fields */
}
Expand description

An Apple ID and its app-specific password.

The password is a SecretString: it is not Serialize, and Debug prints a redaction instead of the characters.

Fields§

§apple_id: AppleId

The primary iCloud address.

Implementations§

Source§

impl Credentials

Source

pub fn new(apple_id: AppleId, secret: impl Into<SecretString>) -> Self

Builds credentials. The password is read back only through Self::with_secret.

Source

pub fn duplicate(&self) -> Self

A second copy, for a second client.

Source

pub fn with_secret<T>(&self, read: impl FnOnce(&str) -> T) -> T

Passes the password to read and ends the borrow before returning.

Trait Implementations§

Source§

impl Debug for Credentials

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Credentials

§

impl Freeze for Credentials

§

impl Move for Credentials

§

impl RefUnwindSafe for Credentials

§

impl Send for Credentials
where RawVecInner: Send, BoxRaw<str>: Send,

§

impl Sync for Credentials
where RawVecInner: Sync, BoxRaw<str>: Sync,

§

impl Unpin for Credentials
where *const u8 is !null: Unpin, Box<str>: Unpin,

§

impl UnsafeUnpin for Credentials

§

impl UnwindSafe for Credentials
where RawVecInner: UnwindSafe, BoxRaw<str>: UnwindSafe,

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.