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>
impl<T> MetaClient<T>
pub fn new_with_transport(maddr: &Vec<HostAddress>, transport: T) -> Self
source§impl<T> MetaClient<T>
impl<T> MetaClient<T>
sourcepub async fn get_all_storage_addrs(
&mut self,
) -> Result<&Vec<HostAddr>, MetaClientError>
pub async fn get_all_storage_addrs( &mut self, ) -> Result<&Vec<HostAddr>, MetaClientError>
Gets all storage addresses.
sourcepub async fn get_tag_id(
&mut self,
space_name: &str,
tag_name: &str,
) -> Result<i32, MetaClientError>
pub async fn get_tag_id( &mut self, space_name: &str, tag_name: &str, ) -> Result<i32, MetaClientError>
Gets the ID of a tag.
sourcepub async fn get_edge_type(
&mut self,
space_name: &str,
edge_name: &str,
) -> Result<i32, MetaClientError>
pub async fn get_edge_type( &mut self, space_name: &str, edge_name: &str, ) -> Result<i32, MetaClientError>
Gets the type of an edge.
sourcepub async fn get_space_id(
&mut self,
space_name: &str,
) -> Result<i32, MetaClientError>
pub async fn get_space_id( &mut self, space_name: &str, ) -> Result<i32, MetaClientError>
Gets the ID of a space.
sourcepub async fn get_tag_schema(
&mut self,
space_name: &str,
tag_name: &str,
) -> Result<&Schema, MetaClientError>
pub async fn get_tag_schema( &mut self, space_name: &str, tag_name: &str, ) -> Result<&Schema, MetaClientError>
Gets the schema of a tag.
sourcepub async fn get_edge_schema(
&mut self,
space_name: &str,
edge_name: &str,
) -> Result<&Schema, MetaClientError>
pub async fn get_edge_schema( &mut self, space_name: &str, edge_name: &str, ) -> Result<&Schema, MetaClientError>
Gets the schema of an edge.
sourcepub async fn get_part_leader(
&mut self,
space_name: &str,
part_id: i32,
) -> Result<&HostAddr, MetaClientError>
pub async fn get_part_leader( &mut self, space_name: &str, part_id: i32, ) -> Result<&HostAddr, MetaClientError>
Gets the leader of a partition.
sourcepub async fn get_part_leaders(
&mut self,
space_name: &str,
) -> Result<&HashMap<i32, HostAddr>, MetaClientError>
pub async fn get_part_leaders( &mut self, space_name: &str, ) -> Result<&HashMap<i32, HostAddr>, MetaClientError>
Gets all part leaders of a space.
sourcepub async fn get_part_alloc(
&mut self,
space_name: &str,
) -> Result<&BTreeMap<i32, Vec<HostAddr>>, MetaClientError>
pub async fn get_part_alloc( &mut self, space_name: &str, ) -> Result<&BTreeMap<i32, Vec<HostAddr>>, MetaClientError>
Gets all part allocations of a space.
sourcepub fn update_storage_leader(
&self,
space_id: i32,
part_id: i32,
address: Option<HostAddr>,
)
pub fn update_storage_leader( &self, space_id: i32, part_id: i32, address: Option<HostAddr>, )
Updates the storage leader.
source§impl MetaClient
impl MetaClient
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> 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