rust_nebula::meta::client

Struct MetaClient

source
pub struct MetaClient<T = AsyncTransport<Compat<TcpStream>, Sleep, MetaTransportResponseHandler>>
where T: Transport + Framing<DecBuf = Cursor<Bytes>>, Bytes: Framing<DecBuf = <T as Framing>::DecBuf>, <<BinaryProtocol as Protocol>::Frame as Framing>::EncBuf: BufMutExt<Final = <<T as Framing>::EncBuf as BufMutExt>::Final>,
{ /* private fields */ }

Implementations§

source§

impl<T> MetaClient<T>
where T: Transport + Framing<DecBuf = Cursor<Bytes>>, Bytes: Framing<DecBuf = <T as Framing>::DecBuf>, <<BinaryProtocol as Protocol>::Frame as Framing>::EncBuf: BufMutExt<Final = <<T as Framing>::EncBuf as BufMutExt>::Final>,

source

pub fn new_with_transport(maddr: &Vec<HostAddress>, transport: T) -> Self

source§

impl<T> MetaClient<T>
where T: Transport + Framing<DecBuf = Cursor<Bytes>>, Bytes: Framing<DecBuf = <T as Framing>::DecBuf>, <<BinaryProtocol as Protocol>::Frame as Framing>::EncBuf: BufMutExt<Final = <<T as Framing>::EncBuf as BufMutExt>::Final>,

source

pub async fn get_all_storage_addrs( &mut self, ) -> Result<&Vec<HostAddr>, MetaClientError>

Gets all storage addresses.

source

pub async fn get_tag_id( &mut self, space_name: &str, tag_name: &str, ) -> Result<i32, MetaClientError>

Gets the ID of a tag.

source

pub async fn get_edge_type( &mut self, space_name: &str, edge_name: &str, ) -> Result<i32, MetaClientError>

Gets the type of an edge.

source

pub async fn get_space_id( &mut self, space_name: &str, ) -> Result<i32, MetaClientError>

Gets the ID of a space.

source

pub async fn get_tag_schema( &mut self, space_name: &str, tag_name: &str, ) -> Result<&Schema, MetaClientError>

Gets the schema of a tag.

source

pub async fn get_edge_schema( &mut self, space_name: &str, edge_name: &str, ) -> Result<&Schema, MetaClientError>

Gets the schema of an edge.

source

pub async fn get_part_leader( &mut self, space_name: &str, part_id: i32, ) -> Result<&HostAddr, MetaClientError>

Gets the leader of a partition.

source

pub async fn get_part_leaders( &mut self, space_name: &str, ) -> Result<&HashMap<i32, HostAddr>, MetaClientError>

Gets all part leaders of a space.

source

pub async fn get_part_alloc( &mut self, space_name: &str, ) -> Result<&BTreeMap<i32, Vec<HostAddr>>, MetaClientError>

Gets all part allocations of a space.

source

pub fn update_storage_leader( &self, space_id: i32, part_id: i32, address: Option<HostAddr>, )

Updates the storage leader.

source§

impl MetaClient

source

pub async fn new(maddr: &Vec<HostAddress>) -> Result<Self, MetaClientError>

Auto Trait Implementations§

§

impl<T> Freeze for MetaClient<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for MetaClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for MetaClient<T>

§

impl<T> Sync for MetaClient<T>

§

impl<T> Unpin for MetaClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for MetaClient<T>
where T: UnwindSafe,

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

source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. 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, 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> 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