Struct typedb_driver::Database
source · pub struct Database { /* private fields */ }
Implementations§
source§impl Database
impl Database
sourcepub fn replicas_info(&self) -> Vec<ReplicaInfo>
pub fn replicas_info(&self) -> Vec<ReplicaInfo>
Returns the Replica
instances for this database.
Only works in TypeDB Cloud
Examples
database.replicas_info()
sourcepub fn primary_replica_info(&self) -> Option<ReplicaInfo>
pub fn primary_replica_info(&self) -> Option<ReplicaInfo>
Returns the primary replica for this database. Only works in TypeDB Cloud
Examples
database.primary_replica_info()
sourcepub fn preferred_replica_info(&self) -> Option<ReplicaInfo>
pub fn preferred_replica_info(&self) -> Option<ReplicaInfo>
Returns the preferred replica for this database. Operations which can be run on any replica will prefer to use this replica. Only works in TypeDB Cloud
Examples
database.preferred_replica_info();
sourcepub async fn type_schema(&self) -> Result<String>
pub async fn type_schema(&self) -> Result<String>
Returns the types in the schema as a valid TypeQL define query string.
Examples
database.type_schema().await;
sourcepub async fn rule_schema(&self) -> Result<String>
pub async fn rule_schema(&self) -> Result<String>
Returns the rules in the schema as a valid TypeQL define query string.
Examples
database.rule_schema().await;
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request