pub struct AuthStatus {
pub logged_in: bool,
pub user: Option<String>,
pub scopes: Vec<String>,
pub hosts: Vec<HostAuthStatus>,
}Expand description
当前认证状态。
由 AuthProvider::status 返回,用于判断用户是否已登录、
当前用户身份以及持有的权限范围。
Fields§
§logged_in: bool用户是否已登录(任一已知 host 已登录即为 true)。
user: Option<String>当前登录用户名(未登录时为 None)。
scopes: Vec<String>已授权的权限范围列表。
hosts: Vec<HostAuthStatus>按 host 拆分的认证状态明细(单 host 平台如 GitHub/GitCode 始终为空数组)。
Trait Implementations§
Source§impl Clone for AuthStatus
impl Clone for AuthStatus
Source§impl Debug for AuthStatus
impl Debug for AuthStatus
Source§impl<'de> Deserialize<'de> for AuthStatus
impl<'de> Deserialize<'de> for AuthStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for AuthStatus
impl Freeze for AuthStatus
impl Move for AuthStatus
impl RefUnwindSafe for AuthStatus
impl Send for AuthStatus
impl Sync for AuthStatus
impl Unpin for AuthStatus
impl UnsafeUnpin for AuthStatus
impl UnwindSafe for AuthStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more