pub struct TypeDBDriver { /* private fields */ }
Expand description
A connection to a TypeDB server which serves as the starting point for all interaction.
Implementations§
Source§impl TypeDBDriver
impl TypeDBDriver
pub const DEFAULT_ADDRESS: &'static str = "localhost:1729"
Sourcepub async fn new_core(
address: impl AsRef<str>,
credentials: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
pub async fn new_core( address: impl AsRef<str>, credentials: Credentials, driver_options: DriverOptions, ) -> Result<Self>
Sourcepub async fn new_core_with_description(
address: impl AsRef<str>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
pub async fn new_core_with_description( address: impl AsRef<str>, credentials: Credentials, driver_options: DriverOptions, driver_lang: impl AsRef<str>, ) -> Result<Self>
Creates a new TypeDB Server connection with a description.
§Arguments
address
— The address (host:port) on which the TypeDB Server is runningCredentials
— The Credentials to connect withdriver_options
— The DriverOptions to connect withdriver_lang
— The language of the driver connecting to the server
§Examples
Connection::new_core("127.0.0.1:1729", "rust").await
Sourcepub async fn new_cloud<T: AsRef<str> + Sync>(
init_addresses: &Vec<T>,
credentials: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
pub async fn new_cloud<T: AsRef<str> + Sync>( init_addresses: &Vec<T>, credentials: Credentials, driver_options: DriverOptions, ) -> Result<Self>
Creates a new TypeDB Cloud connection.
§Arguments
init_addresses
— Addresses (host:port) on which TypeDB Cloud nodes are runningcredentials
— The Credentials to connect withdriver_options
— The DriverOptions to connect with
Sourcepub async fn new_cloud_with_description<T: AsRef<str> + Sync>(
init_addresses: &Vec<T>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
pub async fn new_cloud_with_description<T: AsRef<str> + Sync>( init_addresses: &Vec<T>, credentials: Credentials, driver_options: DriverOptions, driver_lang: impl AsRef<str>, ) -> Result<Self>
Creates a new TypeDB Cloud connection.
§Arguments
init_addresses
— Addresses (host:port) on which TypeDB Cloud nodes are runningcredentials
— The Credentials to connect withdriver_options
— The DriverOptions to connect withdriver_lang
— The language of the driver connecting to the server
Sourcepub async fn new_cloud_with_translation<T, U>(
address_translation: HashMap<T, U>,
credential: Credentials,
driver_options: DriverOptions,
) -> Result<Self>
pub async fn new_cloud_with_translation<T, U>( address_translation: HashMap<T, U>, credential: Credentials, driver_options: DriverOptions, ) -> Result<Self>
Creates a new TypeDB Cloud connection.
§Arguments
address_translation
— Translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s)credential
— The Credentials to connect withdriver_options
— The DriverOptions to connect with
Sourcepub async fn new_cloud_with_translation_with_description<T, U>(
address_translation: HashMap<T, U>,
credentials: Credentials,
driver_options: DriverOptions,
driver_lang: impl AsRef<str>,
) -> Result<Self>
pub async fn new_cloud_with_translation_with_description<T, U>( address_translation: HashMap<T, U>, credentials: Credentials, driver_options: DriverOptions, driver_lang: impl AsRef<str>, ) -> Result<Self>
Creates a new TypeDB Cloud connection.
§Arguments
address_translation
— Translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s)credentials
— The Credentials to connect withdriver_options
— The DriverOptions to connect withdriver_lang
— The language of the driver connecting to the server
pub fn databases(&self) -> &DatabaseManager
pub fn users(&self) -> &UserManager
pub async fn transaction( &self, database_name: impl AsRef<str>, transaction_type: TransactionType, ) -> Result<Transaction>
pub async fn transaction_with_options( &self, database_name: impl AsRef<str>, transaction_type: TransactionType, options: Options, ) -> Result<Transaction>
Sourcepub fn force_close(&self) -> Result
pub fn force_close(&self) -> Result
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TypeDBDriver
impl !RefUnwindSafe for TypeDBDriver
impl Send for TypeDBDriver
impl Sync for TypeDBDriver
impl Unpin for TypeDBDriver
impl !UnwindSafe for TypeDBDriver
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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