agdb_api

Struct AgdbApi

source
pub struct AgdbApi<T: HttpClient> {
    pub token: Option<String>,
    /* private fields */
}

Fields§

§token: Option<String>

Implementations§

source§

impl<T: HttpClient> AgdbApi<T>

source

pub fn new(client: T, address: &str) -> Self

source

pub fn address(&self) -> &str

source

pub fn base_url(&self) -> &str

source

pub async fn admin_db_add( &self, owner: &str, db: &str, db_type: DbType, ) -> AgdbApiResult<u16>

source

pub async fn admin_db_audit( &self, owner: &str, db: &str, ) -> AgdbApiResult<(u16, DbAudit)>

source

pub async fn admin_db_backup(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn admin_db_copy( &self, owner: &str, db: &str, new_owner: &str, new_db: &str, ) -> AgdbApiResult<u16>

source

pub async fn admin_db_delete(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn admin_db_exec( &self, owner: &str, db: &str, queries: &Vec<QueryType>, ) -> AgdbApiResult<(u16, Vec<QueryResult>)>

source

pub async fn admin_db_list(&self) -> AgdbApiResult<(u16, Vec<ServerDatabase>)>

source

pub async fn admin_db_optimize( &self, owner: &str, db: &str, ) -> AgdbApiResult<(u16, ServerDatabase)>

source

pub async fn admin_db_remove(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn admin_db_rename( &self, owner: &str, db: &str, new_owner: &str, new_db: &str, ) -> AgdbApiResult<u16>

source

pub async fn admin_db_restore( &self, owner: &str, db: &str, ) -> AgdbApiResult<u16>

source

pub async fn admin_db_user_add( &self, owner: &str, db: &str, user: &str, db_role: DbUserRole, ) -> AgdbApiResult<u16>

source

pub async fn admin_db_user_list( &self, owner: &str, db: &str, ) -> AgdbApiResult<(u16, Vec<DbUser>)>

source

pub async fn admin_db_user_remove( &self, owner: &str, db: &str, user: &str, ) -> AgdbApiResult<u16>

source

pub async fn admin_shutdown(&self) -> AgdbApiResult<u16>

source

pub async fn admin_user_add( &self, user: &str, password: &str, ) -> AgdbApiResult<u16>

source

pub async fn admin_user_change_password( &self, user: &str, password: &str, ) -> AgdbApiResult<u16>

source

pub async fn admin_user_list(&self) -> AgdbApiResult<(u16, Vec<UserStatus>)>

source

pub async fn admin_user_remove(&self, user: &str) -> AgdbApiResult<u16>

source

pub async fn db_add( &self, owner: &str, db: &str, db_type: DbType, ) -> AgdbApiResult<u16>

source

pub async fn db_audit( &self, owner: &str, db: &str, ) -> AgdbApiResult<(u16, DbAudit)>

source

pub async fn db_backup(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn db_clear( &self, owner: &str, db: &str, resource: DbResource, ) -> AgdbApiResult<(u16, ServerDatabase)>

source

pub async fn db_copy( &self, owner: &str, db: &str, new_owner: &str, new_db: &str, ) -> AgdbApiResult<u16>

source

pub async fn db_delete(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn db_exec( &self, owner: &str, db: &str, queries: &[QueryType], ) -> AgdbApiResult<(u16, Vec<QueryResult>)>

source

pub async fn db_list(&self) -> AgdbApiResult<(u16, Vec<ServerDatabase>)>

source

pub async fn db_optimize( &self, owner: &str, db: &str, ) -> AgdbApiResult<(u16, ServerDatabase)>

source

pub async fn db_remove(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn db_rename( &self, owner: &str, db: &str, new_owner: &str, new_db: &str, ) -> AgdbApiResult<u16>

source

pub async fn db_restore(&self, owner: &str, db: &str) -> AgdbApiResult<u16>

source

pub async fn db_user_add( &self, owner: &str, db: &str, user: &str, db_role: DbUserRole, ) -> AgdbApiResult<u16>

source

pub async fn db_user_list( &self, owner: &str, db: &str, ) -> AgdbApiResult<(u16, Vec<DbUser>)>

source

pub async fn db_user_remove( &self, owner: &str, db: &str, user: &str, ) -> AgdbApiResult<u16>

source

pub async fn status(&self) -> AgdbApiResult<u16>

source

pub async fn cluster_status(&self) -> AgdbApiResult<(u16, Vec<ClusterStatus>)>

source

pub async fn user_login( &mut self, user: &str, password: &str, ) -> AgdbApiResult<u16>

source

pub async fn user_logout(&mut self) -> AgdbApiResult<u16>

source

pub async fn user_change_password( &self, old_password: &str, new_pasword: &str, ) -> AgdbApiResult<u16>

Auto Trait Implementations§

§

impl<T> Freeze for AgdbApi<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for AgdbApi<T>
where T: RefUnwindSafe,

§

impl<T> Send for AgdbApi<T>
where T: Send,

§

impl<T> Sync for AgdbApi<T>
where T: Sync,

§

impl<T> Unpin for AgdbApi<T>
where T: Unpin,

§

impl<T> UnwindSafe for AgdbApi<T>
where T: UnwindSafe,

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.