Struct taos::Taos

source ·
pub struct Taos(/* private fields */);

Implementations§

source§

impl Taos

source

pub fn is_native(&self) -> bool

The connection uses native protocol.

source

pub fn is_ws(&self) -> bool

The connection uses websocket protocol.

Trait Implementations§

source§

impl AsyncBindable<Taos> for Stmt

source§

fn init<'life0, 'async_trait>( taos: &'life0 Taos ) -> Pin<Box<dyn Future<Output = RawResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn init_with_req_id<'life0, 'async_trait>( taos: &'life0 Taos, req_id: u64 ) -> Pin<Box<dyn Future<Output = RawResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn prepare<'life0, 'life1, 'async_trait>( &'life0 mut self, sql: &'life1 str ) -> Pin<Box<dyn Future<Output = RawResult<&mut Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn set_tbname<'life0, 'life1, 'async_trait>( &'life0 mut self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = RawResult<&mut Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn set_tags<'life0, 'life1, 'async_trait>( &'life0 mut self, tags: &'life1 [Value] ) -> Pin<Box<dyn Future<Output = RawResult<&mut Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn bind<'life0, 'life1, 'async_trait>( &'life0 mut self, params: &'life1 [ColumnView] ) -> Pin<Box<dyn Future<Output = RawResult<&mut Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn add_batch<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = RawResult<&mut Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn execute<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = RawResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn affected_rows<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn set_tbname_tags<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, name: &'life1 str, tags: &'life2 [Value] ) -> Pin<Box<dyn Future<Output = Result<&'life0 mut Self, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Send + 'async_trait,

source§

fn result_set<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<<Q as AsyncQueryable>::AsyncResultSet, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Send + 'async_trait,

source§

impl AsyncQueryable for Taos

§

type AsyncResultSet = ResultSet

source§

fn query<'life0, 'async_trait, T>( &'life0 self, sql: T ) -> Pin<Box<dyn Future<Output = RawResult<Self::AsyncResultSet>> + Send + 'async_trait>>
where T: 'async_trait + AsRef<str> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

source§

fn query_with_req_id<'life0, 'async_trait, T>( &'life0 self, sql: T, req_id: u64 ) -> Pin<Box<dyn Future<Output = RawResult<Self::AsyncResultSet>> + Send + 'async_trait>>
where T: 'async_trait + AsRef<str> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

source§

fn write_raw_meta<'life0, 'life1, 'async_trait>( &'life0 self, meta: &'life1 RawMeta ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn write_raw_block<'life0, 'life1, 'async_trait>( &'life0 self, block: &'life1 RawBlock ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn write_raw_block_with_req_id<'life0, 'life1, 'async_trait>( &'life0 self, block: &'life1 RawBlock, req_id: u64 ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn put<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 SmlData ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn exec<'life0, 'async_trait, T>( &'life0 self, sql: T ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + AsRef<str> + Send + Sync, Self: 'async_trait,

source§

fn exec_with_req_id<'life0, 'async_trait, T>( &'life0 self, sql: T, req_id: u64 ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + AsRef<str> + Send + Sync, Self: 'async_trait,

source§

fn exec_many<'life0, 'async_trait, T, I>( &'life0 self, input: I ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: AsRef<str> + Send + Sync + 'async_trait, <I as IntoIterator>::IntoIter: Send, I: IntoIterator<Item = T> + Send + 'async_trait, Self: 'async_trait,

source§

fn query_one<'life0, 'async_trait, T, O>( &'life0 self, sql: T ) -> Pin<Box<dyn Future<Output = Result<Option<O>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + AsRef<str> + Send + Sync, O: 'async_trait + DeserializeOwned + Send, Self: 'async_trait,

To conveniently get first row of the result, useful for queries like Read more
source§

fn server_version<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Cow<'life0, str>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Short for SELECT server_version() as String.
source§

fn create_database<'life0, 'async_trait, N>( &'life0 self, name: N ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, N: 'async_trait + AsRef<str> + Send, Self: 'async_trait,

Short for CREATE DATABASE IF NOT EXISTS {name}.
source§

fn use_database<'life0, 'async_trait, N>( &'life0 self, name: N ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, N: 'async_trait + AsRef<str> + Send, Self: 'async_trait,

Short for USE {name}.
source§

fn create_topic<'life0, 'async_trait, N, S>( &'life0 self, name: N, sql: S ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, N: 'async_trait + AsRef<str> + Send + Sync, S: 'async_trait + AsRef<str> + Send, Self: 'async_trait,

Short for CREATE TOPIC IF NOT EXISTS {name} AS {sql}.
source§

fn create_topic_as_database<'life0, 'async_trait>( &'life0 self, name: impl AsRef<str> + Send + Sync + 'async_trait, db: impl Display + Send + 'async_trait ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Short for CREATE TOPIC IF NOT EXISTS {name} WITH META AS DATABASE {db}.
source§

fn databases<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<ShowDatabase>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Short for SHOW DATABASES.
source§

fn topics<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<Topic>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Topics information by SELECT * FROM information_schema.ins_topics sql. Read more
source§

fn describe<'life0, 'life1, 'async_trait>( &'life0 self, table: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Describe, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get table meta information.
source§

fn database_exists<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Check if database exists
source§

fn exec_sync<T>(&self, sql: T) -> Result<usize, Error>
where T: AsRef<str> + Send + Sync,

Sync version of exec.
source§

fn query_sync<T>(&self, sql: T) -> Result<Self::AsyncResultSet, Error>
where T: AsRef<str> + Send + Sync,

Sync version of query.
source§

impl Bindable<Taos> for Stmt

source§

fn init(taos: &Taos) -> RawResult<Self>

source§

fn init_with_req_id(taos: &Taos, req_id: u64) -> RawResult<Self>

source§

fn prepare<S: AsRef<str>>(&mut self, sql: S) -> RawResult<&mut Self>

source§

fn set_tbname<S: AsRef<str>>(&mut self, name: S) -> RawResult<&mut Self>

source§

fn set_tags(&mut self, tags: &[Value]) -> RawResult<&mut Self>

source§

fn bind(&mut self, params: &[ColumnView]) -> RawResult<&mut Self>

source§

fn add_batch(&mut self) -> RawResult<&mut Self>

source§

fn execute(&mut self) -> RawResult<usize>

source§

fn affected_rows(&self) -> usize

source§

fn set_tbname_tags<S>( &mut self, name: S, tags: &[Value] ) -> Result<&mut Self, Error>
where S: AsRef<str>,

source§

fn result_set(&mut self) -> Result<<Q as Queryable>::ResultSet, Error>

source§

impl Debug for Taos

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Queryable for Taos

§

type ResultSet = ResultSet

source§

fn query<T: AsRef<str>>(&self, sql: T) -> RawResult<Self::ResultSet>

source§

fn query_with_req_id<T: AsRef<str>>( &self, sql: T, req_id: u64 ) -> RawResult<Self::ResultSet>

source§

fn write_raw_meta(&self, meta: &RawMeta) -> RawResult<()>

source§

fn write_raw_block(&self, block: &RawBlock) -> RawResult<()>

source§

fn write_raw_block_with_req_id( &self, block: &RawBlock, req_id: u64 ) -> RawResult<()>

source§

fn put(&self, data: &SmlData) -> RawResult<()>

source§

fn exec<T>(&self, sql: T) -> Result<usize, Error>
where T: AsRef<str>,

source§

fn exec_many<T, I>(&self, input: I) -> Result<usize, Error>
where T: AsRef<str>, I: IntoIterator<Item = T>,

source§

fn query_one<T, O>(&self, sql: T) -> Result<Option<O>, Error>
where T: AsRef<str>, O: DeserializeOwned,

source§

fn server_version(&self) -> Result<Cow<'_, str>, Error>

Short for SELECT server_version() as String.
source§

fn create_topic( &self, name: impl AsRef<str>, sql: impl AsRef<str> ) -> Result<(), Error>

source§

fn create_topic_as_database( &self, name: impl AsRef<str>, db: impl Display ) -> Result<(), Error>

source§

fn databases(&self) -> Result<Vec<ShowDatabase>, Error>

source§

fn topics(&self) -> Result<Vec<Topic>, Error>

Topics information by SELECT * FROM information_schema.ins_topics sql. Read more
source§

fn describe(&self, table: &str) -> Result<Describe, Error>

source§

fn database_exists(&self, name: &str) -> Result<bool, Error>

Check if database exists

Auto Trait Implementations§

§

impl !Freeze for Taos

§

impl !RefUnwindSafe for Taos

§

impl Send for Taos

§

impl Sync for Taos

§

impl Unpin for Taos

§

impl !UnwindSafe for Taos

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

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more