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>
impl Client<DefaultRequestExecutor>
pub fn new(apikey: &str) -> Client<DefaultRequestExecutor>
Source§impl<R> Client<R>where
R: RequestExecutor,
impl<R> Client<R>where
R: RequestExecutor,
pub fn new_with_request_executor<RR>(
apikey: &str,
request_exec: RR,
) -> Client<RR>where
RR: RequestExecutor,
pub fn endpoint(&mut self, endpoint: &str) -> &Self
pub fn import_endpoint(&mut self, endpoint: &str) -> &Self
pub fn databases(&self) -> Result<Vec<Database>, TreasureDataError>
pub fn create_database(&self, name: &str) -> Result<(), TreasureDataError>
pub fn delete_database(&self, name: &str) -> Result<(), TreasureDataError>
pub fn tables( &self, database_name: &str, ) -> Result<Vec<Table>, TreasureDataError>
pub fn tail_table( &self, database_name: &str, name: &str, ) -> Result<(), TreasureDataError>
pub fn create_table( &self, database_name: &str, name: &str, ) -> Result<(), TreasureDataError>
pub fn delete_table( &self, database_name: &str, name: &str, ) -> Result<(), TreasureDataError>
pub fn rename_table( &self, database_name: &str, name: &str, new_name: &str, ) -> Result<(), TreasureDataError>
pub fn swap_table( &self, database_name: &str, name_a: &str, name_b: &str, ) -> Result<(), TreasureDataError>
pub fn append_schema( &self, database_name: &str, table_name: &str, schemas: &Vec<(&str, SchemaType)>, ) -> Result<(), TreasureDataError>
pub fn copy_table_schema( &self, src_database_name: &str, src_table_name: &str, dst_database_name: &str, dst_table_name: &str, ) -> Result<(), TreasureDataError>
pub fn import_msgpack_gz_to_table( &self, database_name: &str, name: &str, data: impl Into<Body>, unique_id: Option<&str>, ) -> Result<(), TreasureDataError>
pub fn import_msgpack_gz_file_to_table( &self, database_name: &str, name: &str, file_path: &str, unique_id: Option<&str>, ) -> Result<(), TreasureDataError>
pub fn jobs( &self, status: Option<JobStatusOption>, from: Option<u64>, to: Option<u64>, ) -> Result<Jobs, TreasureDataError>
pub fn job(&self, job_id: u64) -> Result<Job, TreasureDataError>
pub fn job_status(&self, job_id: u64) -> Result<JobStatus, TreasureDataError>
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>
pub fn wait_job( &self, job_id: u64, interval_secs: Option<u64>, ) -> Result<JobStatus, TreasureDataError>
pub fn job_result( &self, job_id: u64, ) -> Result<(Response, usize), TreasureDataError>
pub fn download_job_result( &self, job_id: u64, out_file: &File, ) -> Result<(), TreasureDataError>
pub fn each_row_in_job_result<F>( &self, job_id: u64, f: &F, ) -> Result<(), TreasureDataError>
pub fn each_row_in_job_result_file<F>( &self, in_file: &File, f: &F, ) -> Result<(), TreasureDataError>
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> 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> 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 more