td_client::client

Struct Client

Source
pub struct Client<R: RequestExecutor> {
    pub apikey: String,
    pub endpoint: String,
    pub import_endpoint: String,
    /* private fields */
}

Fields§

§apikey: String§endpoint: String§import_endpoint: String

Implementations§

Source§

impl Client<DefaultRequestExecutor>

Source§

impl<R> Client<R>
where R: RequestExecutor,

Source

pub fn new_with_request_executor<RR>( apikey: &str, request_exec: RR, ) -> Client<RR>
where RR: RequestExecutor,

Source

pub fn endpoint(&mut self, endpoint: &str) -> &Self

Source

pub fn import_endpoint(&mut self, endpoint: &str) -> &Self

Source

pub fn databases(&self) -> Result<Vec<Database>, TreasureDataError>

Source

pub fn create_database(&self, name: &str) -> Result<(), TreasureDataError>

Source

pub fn delete_database(&self, name: &str) -> Result<(), TreasureDataError>

Source

pub fn tables( &self, database_name: &str, ) -> Result<Vec<Table>, TreasureDataError>

Source

pub fn tail_table( &self, database_name: &str, name: &str, ) -> Result<(), TreasureDataError>

Source

pub fn create_table( &self, database_name: &str, name: &str, ) -> Result<(), TreasureDataError>

Source

pub fn delete_table( &self, database_name: &str, name: &str, ) -> Result<(), TreasureDataError>

Source

pub fn rename_table( &self, database_name: &str, name: &str, new_name: &str, ) -> Result<(), TreasureDataError>

Source

pub fn swap_table( &self, database_name: &str, name_a: &str, name_b: &str, ) -> Result<(), TreasureDataError>

Source

pub fn append_schema( &self, database_name: &str, table_name: &str, schemas: &Vec<(&str, SchemaType)>, ) -> Result<(), TreasureDataError>

Source

pub fn copy_table_schema( &self, src_database_name: &str, src_table_name: &str, dst_database_name: &str, dst_table_name: &str, ) -> Result<(), TreasureDataError>

Source

pub fn import_msgpack_gz_to_table( &self, database_name: &str, name: &str, data: impl Into<Body>, unique_id: Option<&str>, ) -> Result<(), TreasureDataError>

Source

pub fn import_msgpack_gz_file_to_table( &self, database_name: &str, name: &str, file_path: &str, unique_id: Option<&str>, ) -> Result<(), TreasureDataError>

Source

pub fn jobs( &self, status: Option<JobStatusOption>, from: Option<u64>, to: Option<u64>, ) -> Result<Jobs, TreasureDataError>

Source

pub fn job(&self, job_id: u64) -> Result<Job, TreasureDataError>

Source

pub fn job_status(&self, job_id: u64) -> Result<JobStatus, TreasureDataError>

Source

pub fn issue_job( &self, query_type: QueryType, database_name: &str, query: &str, result_url: Option<&str>, priority: Option<u64>, retry_limit: Option<u64>, domain_key: Option<&str>, scheduled_time: Option<TimeStamp>, ) -> Result<u64, TreasureDataError>

Source

pub fn wait_job( &self, job_id: u64, interval_secs: Option<u64>, ) -> Result<JobStatus, TreasureDataError>

Source

pub fn job_result( &self, job_id: u64, ) -> Result<(Response, usize), TreasureDataError>

Source

pub fn download_job_result( &self, job_id: u64, out_file: &File, ) -> Result<(), TreasureDataError>

Source

pub fn each_row_in_job_result<F>( &self, job_id: u64, f: &F, ) -> Result<(), TreasureDataError>
where F: Fn(Vec<Value>) -> bool,

Source

pub fn each_row_in_job_result_file<F>( &self, in_file: &File, f: &F, ) -> Result<(), TreasureDataError>
where F: Fn(Vec<Value>) -> bool,

Source

pub fn kill_job(&self, job_id: u64) -> Result<(), TreasureDataError>

Auto Trait Implementations§

§

impl<R> Freeze for Client<R>
where R: Freeze,

§

impl<R> !RefUnwindSafe for Client<R>

§

impl<R> Send for Client<R>
where R: Send,

§

impl<R> Sync for Client<R>
where R: Sync,

§

impl<R> Unpin for Client<R>
where R: Unpin,

§

impl<R> !UnwindSafe for Client<R>

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

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
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.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Err = <U as TryFrom<T>>::Err

Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T