Skip to main content

Application

Struct Application 

Source
pub struct Application { /* private fields */ }
Expand description

One application environment on a FeltDB server. Cheap to clone.

Implementations§

Source§

impl Application

Source

pub fn environment(self, environment: impl Into<String>) -> Self

The same application in another environment.

Source

pub fn id(&self) -> &str

Source

pub fn environment_name(&self) -> &str

Source

pub async fn discover(&self) -> Result<ApplicationInfo>

Discover the environment’s active contract, and remember its revision for later requests.

Source

pub async fn revision_id(&self) -> Result<String>

The revision canonical requests are evaluated against: cached after the first discovery. Call Application::discover again after a promotion to move to the new revision.

Source

pub async fn state_version(&self) -> Result<StateVersion>

The committed state version of the environment’s state, at its active revision.

Source

pub async fn query(&self, query: &CanonicalQuery) -> Result<QueryResult>

Run a canonical query, authorized by the contract’s read policy for the collection.

Source

pub async fn commit(&self, transaction: &AppTransaction) -> Result<AppCommit>

Commit a canonical transaction.

Source

pub async fn read_basis(&self, reads: &ReadSet) -> Result<ReadBasis>

Capture a read basis over the application’s state, under the caller’s read authorization.

Source

pub async fn events(&self, cursor: Option<&str>) -> Result<EventStream>

Committed changes to this application as they happen, from cursor or from now.

Source

pub async fn replay( &self, cursor: Option<&str>, limit: Option<usize>, ) -> Result<ReplayPage>

A bounded page of committed history from cursor (the start when None), at most limit events (the server caps it at 256). Replay, not the live stream, is the authority on history.

Source

pub async fn provenance(&self, collection: &str, id: &str) -> Result<Value>

The complete mutation chain of one record.

Source

pub async fn sign_in(&self, email: &str, password: &str) -> Result<Value>

Sign an end user in to this application; the session’s access token becomes this client’s bearer token.

Source

pub async fn sign_up( &self, email: &str, password: &str, display_name: Option<&str>, ) -> Result<Value>

Register an end user of this application and sign them in.

Source

pub async fn session(&self) -> Result<Value>

The current session’s principal.

Source

pub async fn sign_out(&self) -> Result<()>

End the current session and clear this client’s token.

Trait Implementations§

Source§

impl Clone for Application

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Application

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more