Struct alexandria::SessionsApi[][src]

pub struct SessionsApi<'alex> { /* fields omitted */ }

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,