pub struct ClusterStore { /* private fields */ }Expand description
Persistent cluster state store.
Implementations§
Source§impl ClusterStore
impl ClusterStore
Sourcepub fn get_service(&self, name: &str) -> Result<Option<ServiceConfig>>
pub fn get_service(&self, name: &str) -> Result<Option<ServiceConfig>>
Get a service config by name.
pub fn set_service(&self, name: &str, config: &ServiceConfig) -> Result<()>
pub fn remove_service(&self, name: &str) -> Result<()>
Sourcepub fn get_all_services(&self) -> Result<HashMap<String, ServiceConfig>>
pub fn get_all_services(&self) -> Result<HashMap<String, ServiceConfig>>
Get all service configs.
Sourcepub fn get_assignments(&self, service: &str) -> Result<Vec<Assignment>>
pub fn get_assignments(&self, service: &str) -> Result<Vec<Assignment>>
Get assignments for a service.
Sourcepub fn snapshot(&self) -> Result<RaftSnapshot>
pub fn snapshot(&self) -> Result<RaftSnapshot>
Take a full snapshot of the store.
Sourcepub fn get_all_assignments(&self) -> Result<Vec<Assignment>>
pub fn get_all_assignments(&self) -> Result<Vec<Assignment>>
Get all assignments across all services.
Source§impl ClusterStore
impl ClusterStore
Sourcepub fn restore_from_snapshot(&self, snap: &RaftSnapshot) -> Result<()>
pub fn restore_from_snapshot(&self, snap: &RaftSnapshot) -> Result<()>
Restore the store from a snapshot, replacing all data atomically.
Auto Trait Implementations§
impl Freeze for ClusterStore
impl !RefUnwindSafe for ClusterStore
impl Send for ClusterStore
impl Sync for ClusterStore
impl Unpin for ClusterStore
impl UnsafeUnpin for ClusterStore
impl !UnwindSafe for ClusterStore
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request