Struct alexandria::SessionsApi [−][src]
Api scope wrapper for database sessions
A session is some random Id which is used as a namespace
identifier. Each session namespace is encrypted independently,
with a unique key, and record tree. This means that two paths
(say /foo:bar
) can point to two separate records in the
database, if they belong to different sessions.
An important distiction to make here: a session is not ephemeral but a long living namespace Id, similar to a user in a traditional database.
Implementations
impl<'alex> SessionsApi<'alex>
[src]
pub async fn list(&self) -> Vec<Id>
[src]
List available sessions in this database
pub async fn open(&self, id: Id, pw: &str) -> Result<Session>
[src]
Open a previously created session
pub async fn close(&self, id: Session) -> Result<()>
[src]
Close an active session
pub async fn create(&self, id: Id, pw: &str) -> Result<Session>
[src]
Create a new session with a unique encryption key
pub async fn destroy(&self, id: Session) -> Result<()>
[src]
Remove a session Id and corresponding data from the database
Auto Trait Implementations
impl<'alex> !RefUnwindSafe for SessionsApi<'alex>
impl<'alex> Send for SessionsApi<'alex>
impl<'alex> Sync for SessionsApi<'alex>
impl<'alex> Unpin for SessionsApi<'alex>
impl<'alex> !UnwindSafe for SessionsApi<'alex>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,