pub struct LinksTokenTable<L: NamedTypeLinks> { /* private fields */ }Expand description
The tokens a links server knows, stored as links (issue #149): the
authenticator of (auth: token) that clink --tokens uses.
A subject s of the data has a pair (p: Token s), where Token is the
point named Token, and each of its tokens is a link (t: p t), named
sha256:<hex> after the SHA-256 of the token, so the store never holds a
token itself. The table lives in a store of its own or in the data; any
other authenticator is a callback of
LinksSessions.
Implementations§
Source§impl<L: NamedTypeLinks> LinksTokenTable<L>
impl<L: NamedTypeLinks> LinksTokenTable<L>
Sourcepub const TOKEN_NAME: &'static str = "Token"
pub const TOKEN_NAME: &'static str = "Token"
The name of the point every token link starts from.
pub fn new(store: L) -> Self
pub fn store(&self) -> &L
pub fn store_mut(&mut self) -> &mut L
pub fn into_inner(self) -> L
Sourcepub fn authenticate(&mut self, token: &str) -> Result<Option<u32>>
pub fn authenticate(&mut self, token: &str) -> Result<Option<u32>>
The subject of token, or None when the table does not know it.
Auto Trait Implementations§
impl<L> Freeze for LinksTokenTable<L>where
L: Freeze,
impl<L> RefUnwindSafe for LinksTokenTable<L>where
L: RefUnwindSafe,
impl<L> Send for LinksTokenTable<L>where
L: Send,
impl<L> Sync for LinksTokenTable<L>where
L: Sync,
impl<L> Unpin for LinksTokenTable<L>where
L: Unpin,
impl<L> UnsafeUnpin for LinksTokenTable<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for LinksTokenTable<L>where
L: UnwindSafe,
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