pub struct Application { /* private fields */ }Expand description
One application environment on a FeltDB server. Cheap to clone.
Implementations§
Source§impl Application
impl Application
Sourcepub fn environment(self, environment: impl Into<String>) -> Self
pub fn environment(self, environment: impl Into<String>) -> Self
The same application in another environment.
pub fn id(&self) -> &str
pub fn environment_name(&self) -> &str
Sourcepub async fn discover(&self) -> Result<ApplicationInfo>
pub async fn discover(&self) -> Result<ApplicationInfo>
Discover the environment’s active contract, and remember its revision for later requests.
Sourcepub async fn revision_id(&self) -> Result<String>
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.
Sourcepub async fn state_version(&self) -> Result<StateVersion>
pub async fn state_version(&self) -> Result<StateVersion>
The committed state version of the environment’s state, at its active revision.
Sourcepub async fn query(&self, query: &CanonicalQuery) -> Result<QueryResult>
pub async fn query(&self, query: &CanonicalQuery) -> Result<QueryResult>
Run a canonical query, authorized by the contract’s read policy for the collection.
Sourcepub async fn commit(&self, transaction: &AppTransaction) -> Result<AppCommit>
pub async fn commit(&self, transaction: &AppTransaction) -> Result<AppCommit>
Commit a canonical transaction.
Sourcepub async fn read_basis(&self, reads: &ReadSet) -> Result<ReadBasis>
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.
Sourcepub async fn events(&self, cursor: Option<&str>) -> Result<EventStream>
pub async fn events(&self, cursor: Option<&str>) -> Result<EventStream>
Committed changes to this application as they happen, from cursor or from now.
Sourcepub async fn replay(
&self,
cursor: Option<&str>,
limit: Option<usize>,
) -> Result<ReplayPage>
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.
Sourcepub async fn provenance(&self, collection: &str, id: &str) -> Result<Value>
pub async fn provenance(&self, collection: &str, id: &str) -> Result<Value>
The complete mutation chain of one record.
Sourcepub async fn sign_in(&self, email: &str, password: &str) -> Result<Value>
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.