pub struct RealmStorage {
pub size: u64,
/* private fields */
}Expand description
The DHTStorageCore structure holds a configuration and the storage needed to persist over reloads of the node.
Fields§
§size: u64Implementations§
Source§impl RealmStorage
impl RealmStorage
pub fn new(dht_config: DHTConfig, realm: FloRealm) -> Result<Self>
pub fn flo_distribution(&self) -> Vec<usize>
pub fn flo_count(&self) -> usize
pub fn realm_config(&self) -> &RealmConfig
pub fn get_flo_cuckoo(&self, id: &FloID) -> Option<FloCuckoo>
pub fn get_all_flo_cuckoos(&self) -> Vec<FloCuckoo> ⓘ
pub fn get_cuckoo_ids(&self, key: &FloID) -> Option<Vec<FloID>>
pub fn get_flo_metas(&self) -> Vec<FloMeta>
pub fn store_cuckoo_ids(&mut self, parent: &FloID, cuckoos: Vec<FloID>)
pub fn store_cuckoo_id(&mut self, parent: &FloID, cuckoo: FloID)
Sourcepub fn sync_available(&self, available: &Vec<FloMeta>) -> Option<Vec<FloID>>
pub fn sync_available(&self, available: &Vec<FloMeta>) -> Option<Vec<FloID>>
TODO: decide which IDs need to be stored.
pub fn upsert_flo(&mut self, flo: Flo) -> bool
Trait Implementations§
Source§impl Clone for RealmStorage
impl Clone for RealmStorage
Source§fn clone(&self) -> RealmStorage
fn clone(&self) -> RealmStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RealmStorage
impl Debug for RealmStorage
Source§impl<'de> Deserialize<'de> for RealmStorage
impl<'de> Deserialize<'de> for RealmStorage
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<RealmStorage> for RealmStorageV1
impl From<RealmStorage> for RealmStorageV1
Source§fn from(orig: RealmStorage) -> Self
fn from(orig: RealmStorage) -> Self
Converts to this type from the input type.
Source§impl From<RealmStorageV1> for RealmStorage
impl From<RealmStorageV1> for RealmStorage
Source§fn from(new: RealmStorageV1) -> Self
fn from(new: RealmStorageV1) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RealmStorage
impl PartialEq for RealmStorage
Source§impl Serialize for RealmStorage
impl Serialize for RealmStorage
impl StructuralPartialEq for RealmStorage
Auto Trait Implementations§
impl Freeze for RealmStorage
impl RefUnwindSafe for RealmStorage
impl Send for RealmStorage
impl Sync for RealmStorage
impl Unpin for RealmStorage
impl UnwindSafe for RealmStorage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more