Skip to main content

ClientHandle

Struct ClientHandle 

Source
pub struct ClientHandle { /* private fields */ }
Expand description

Clickhouse client handle.

Implementations§

Source§

impl ClientHandle

Source

pub async fn ping(&mut self) -> Result<()>

Source

pub fn query<Q>(&mut self, sql: Q) -> QueryResult<'_>
where Query: From<Q>,

Executes Clickhouse query on Conn.

Source

pub async fn execute<Q>(&mut self, sql: Q) -> Result<()>
where Query: From<Q>,

Convenience method to prepare and execute a single SQL statement.

Source

pub async fn insert<Q, B>(&mut self, table: Q, block: B) -> Result<()>
where Query: From<Q>, B: AsRef<Block>,

Convenience method to insert block of data.

Source

pub async fn check_connection(&mut self) -> Result<()>

Check connection and try to reconnect if necessary.

Trait Implementations§

Source§

impl Debug for ClientHandle

Source§

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

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

impl Drop for ClientHandle

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Freeze for ClientHandle

§

impl !RefUnwindSafe for ClientHandle

§

impl !UnwindSafe for ClientHandle

§

impl Forget for ClientHandle

§

impl Move for ClientHandle

§

impl Send for ClientHandle
where I32NotAllOnes: Send, Atomic<usize>: Send, Registration: Send, BoxRaw<dyn State<ClientConnectionData>>: Send, RawVecInner: Send, &'static str: Send, Arc<dyn Error + Sync + Send>: Send, &'static Tls12CipherSuite: Send, &'static Tls13CipherSuite: Send, BoxRaw<dyn MessageEncrypter>: Send, BoxRaw<dyn MessageDecrypter>: Send, &'static [u8]: Send, &'static dyn Algorithm: Send, Repr: Send, Arc<Mutex<State>>: Send, Arc<Vec<u8>>: Send, NonZero<i32>: Send, TzOffset: Send, &'static SqlType: Send, BoxRaw<Value>: Send, Arc<Vec<Value>>: Send, Arc<HashMap<Value, Value>>: Send, Arc<Vec<(String, Value)>>: Send, Arc<dyn ColumnData + Sync + Send>: Send, BoxRaw<Cmd>: Send, RawTable<((usize, Scanned), Scan)>: Send, Arc<TransportStatus>: Send, Arc<Inner>: Send,

§

impl Sync for ClientHandle
where I32NotAllOnes: Sync, Atomic<usize>: Sync, Registration: Sync, BoxRaw<dyn State<ClientConnectionData>>: Sync, RawVecInner: Sync, Arc<dyn Error + Sync + Send>: Sync, BoxRaw<dyn MessageEncrypter>: Sync, BoxRaw<dyn MessageDecrypter>: Sync, Repr: Sync, Arc<Mutex<State>>: Sync, Arc<Vec<u8>>: Sync, NonZero<i32>: Sync, TzOffset: Sync, BoxRaw<Value>: Sync, Arc<Vec<Value>>: Sync, Arc<HashMap<Value, Value>>: Sync, Arc<Vec<(String, Value)>>: Sync, Arc<dyn ColumnData + Sync + Send>: Sync, BoxRaw<Cmd>: Sync, RawTable<((usize, Scanned), Scan)>: Sync, Arc<TransportStatus>: Sync, Arc<Inner>: Sync,

§

impl Unpin for ClientHandle
where ClickhouseTransport: Unpin, *const u8 is !null: Unpin, Arc<Mutex<State>>: Unpin, Arc<Inner>: Unpin,

§

impl UnsafeUnpin for ClientHandle
where I32NotAllOnes: UnsafeUnpin, Align8<usize>: UnsafeUnpin, *const ArcInner<Handle> is !null: UnsafeUnpin, PhantomData<ArcInner<Handle>>: UnsafeUnpin, *const ArcInner<Handle> is !null: UnsafeUnpin, PhantomData<ArcInner<Handle>>: UnsafeUnpin, *const ArcInner<ScheduledIo> is !null: UnsafeUnpin, PhantomData<ArcInner<ScheduledIo>>: UnsafeUnpin, *const dyn State<ClientConnectionData> is !null: UnsafeUnpin, PhantomData<dyn State<ClientConnectionData>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<ContentType>: UnsafeUnpin, PhantomData<HandshakeType>: UnsafeUnpin, &'static str: UnsafeUnpin, *const ArcInner<dyn Error + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Error + Sync + Send>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, &'static Tls12CipherSuite: UnsafeUnpin, &'static Tls13CipherSuite: UnsafeUnpin, *const dyn MessageEncrypter is !null: UnsafeUnpin, PhantomData<dyn MessageEncrypter>: UnsafeUnpin, *const dyn MessageDecrypter is !null: UnsafeUnpin, PhantomData<dyn MessageDecrypter>: UnsafeUnpin, PhantomData<CertificateDer<'static>>: UnsafeUnpin, PhantomData<Vec<u8>>: UnsafeUnpin, PhantomData<(bool, Vec<u8>)>: UnsafeUnpin, &'static dyn Algorithm: UnsafeUnpin, *const () is !null: UnsafeUnpin, PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin, PhantomData<Cmd>: UnsafeUnpin, PhantomData<((usize, Scanned), Scan)>: UnsafeUnpin, *const ArcInner<TransportStatus> is !null: UnsafeUnpin, PhantomData<ArcInner<TransportStatus>>: UnsafeUnpin, *const ArcInner<Mutex<State>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<State>>>: UnsafeUnpin, *const ArcInner<Inner> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner>>: UnsafeUnpin,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.