pub struct LocalStore<S, C> where
    S: Spec,
    C: MetadataItem
{ /* private fields */ }
Expand description

Idempotent local memory cache of meta objects. There are only 2 write operations are permitted: sync and apply changes which are idempotent. For read, read guards are provided which provide hash map API using deref.
Hash values are wrapped in EpochCounter. EpochCounter is also deref. Using async lock to ensure read/write are thread safe.

Implementations

initialize local stores with list of metadata objects

create arc wrapper

Read guard

write guard, this is private, use sync API to make changes

current epoch

initial epoch that should be used store will always have epoch greater than init_epoch if there are any changes

copy of the value

copy spec

iterate over entry

create new change listener

sync with incoming changes as source of truth. any objects not in incoming list will be deleted after sync operation, prior history will be removed and any subsequent change query will return full list instead of changes

apply changes to this store if item doesn’t exit, it will be treated as add if item exist but different, it will be treated as updated epoch will be only incremented if there are actual changes which means this is idempotent operations. same add result in only 1 single epoch increase.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more