Struct pd_client::client::RpcClient[][src]

pub struct RpcClient {
    cluster_id: u64,
    pd_client: Arc<Client>,
    monitor: Arc<ThreadPool<TaskCell>>,
}

Fields

cluster_id: u64pd_client: Arc<Client>monitor: Arc<ThreadPool<TaskCell>>

Implementations

impl RpcClient[src]

pub fn new(
    cfg: &Config,
    shared_env: Option<Arc<Environment>>,
    security_mgr: Arc<SecurityManager>
) -> Result<RpcClient>
[src]

pub async fn new_async(
    cfg: &Config,
    shared_env: Option<Arc<Environment>>,
    security_mgr: Arc<SecurityManager>
) -> Result<RpcClient>
[src]

fn header(&self) -> RequestHeader[src]

Creates a new request header.

pub fn get_leader(&self) -> Member[src]

Gets the leader of PD.

pub fn reconnect(&self) -> Result<()>[src]

Re-establishes connection with PD leader in synchronized fashion.

fn call_option(client: &Client) -> CallOption[src]

Creates a new call option with default request timeout.

fn get_region_and_leader(&self, key: &[u8]) -> PdFuture<(Region, Option<Peer>)>[src]

Gets given key’s Region and Region’s leader from PD.

fn get_store_and_stats(&self, store_id: u64) -> PdFuture<(Store, StoreStats)>[src]

Trait Implementations

impl Debug for RpcClient[src]

impl PdClient for RpcClient[src]

Auto Trait Implementations

impl !RefUnwindSafe for RpcClient

impl Send for RpcClient

impl Sync for RpcClient

impl Unpin for RpcClient

impl !UnwindSafe for RpcClient

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]