pub trait AsyncConnectionService {
// Required methods
fn create_connection(
&self,
auth_: BearerToken,
create_connection: CreateConnection,
) -> impl Future<Output = Result<Connection, Error>> + Send;
fn update_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: UpdateConnectionRequest,
) -> impl Future<Output = Result<Connection, Error>> + Send;
fn update_connection_status(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: ConnectionStatus,
) -> impl Future<Output = Result<(), Error>> + Send;
fn add_available_tags(
&self,
auth_: BearerToken,
rid: ConnectionRid,
tags: BTreeMap<TagName, BTreeSet<TagValue>>,
) -> impl Future<Output = Result<Connection, Error>> + Send;
fn get_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> impl Future<Output = Result<Connection, Error>> + Send;
fn get_connections(
&self,
auth_: BearerToken,
rids: BTreeSet<ConnectionRid>,
) -> impl Future<Output = Result<BTreeSet<Connection>, Error>> + Send;
fn list_connections(
&self,
auth_: BearerToken,
include_archived: Option<bool>,
workspaces: BTreeSet<WorkspaceRid>,
) -> impl Future<Output = Result<BTreeSet<Connection>, Error>> + Send;
fn archive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> impl Future<Output = Result<(), Error>> + Send;
fn unarchive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> impl Future<Output = Result<(), Error>> + Send;
}
Expand description
A Connection contains the relevant metadata and information to be used as a data source for runs. The Connection Service is responsible for creating, updating, and retrieving database connections.
Required Methods§
Sourcefn create_connection(
&self,
auth_: BearerToken,
create_connection: CreateConnection,
) -> impl Future<Output = Result<Connection, Error>> + Send
fn create_connection( &self, auth_: BearerToken, create_connection: CreateConnection, ) -> impl Future<Output = Result<Connection, Error>> + Send
Creates a new connection.
Sourcefn update_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: UpdateConnectionRequest,
) -> impl Future<Output = Result<Connection, Error>> + Send
fn update_connection( &self, auth_: BearerToken, rid: ConnectionRid, request: UpdateConnectionRequest, ) -> impl Future<Output = Result<Connection, Error>> + Send
Updates an existing connection.
Sourcefn update_connection_status(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: ConnectionStatus,
) -> impl Future<Output = Result<(), Error>> + Send
fn update_connection_status( &self, auth_: BearerToken, rid: ConnectionRid, request: ConnectionStatus, ) -> impl Future<Output = Result<(), Error>> + Send
Updates an existing connection status.
Adds available tag key/value pairs to the connection. If a tag name already exists, the values will be merged. This is primarily an internal endpoint to update tags for external connections as they are periodically scraped. This endpoint should only be called by clients for Visual crossing connections. Throws if called for Nominal connections which have their tags automatically indexed in the underlying Database.
Sourcefn get_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> impl Future<Output = Result<Connection, Error>> + Send
fn get_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> impl Future<Output = Result<Connection, Error>> + Send
Gets a connection by its RID.
Sourcefn get_connections(
&self,
auth_: BearerToken,
rids: BTreeSet<ConnectionRid>,
) -> impl Future<Output = Result<BTreeSet<Connection>, Error>> + Send
fn get_connections( &self, auth_: BearerToken, rids: BTreeSet<ConnectionRid>, ) -> impl Future<Output = Result<BTreeSet<Connection>, Error>> + Send
Gets a set of connections by their RIDs.
Sourcefn list_connections(
&self,
auth_: BearerToken,
include_archived: Option<bool>,
workspaces: BTreeSet<WorkspaceRid>,
) -> impl Future<Output = Result<BTreeSet<Connection>, Error>> + Send
fn list_connections( &self, auth_: BearerToken, include_archived: Option<bool>, workspaces: BTreeSet<WorkspaceRid>, ) -> impl Future<Output = Result<BTreeSet<Connection>, Error>> + Send
Lists all connections.
Sourcefn archive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> impl Future<Output = Result<(), Error>> + Send
fn archive_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> impl Future<Output = Result<(), Error>> + Send
Archives a connection, which simply tags the connection for a client to filter.
Sourcefn unarchive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> impl Future<Output = Result<(), Error>> + Send
fn unarchive_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> impl Future<Output = Result<(), Error>> + Send
Undoes the archiving of a connection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.