pub(crate) struct CommandStorage {
entries: SyncRwLock<FxHashMap<Identifier, NbtCompound>>,
revision: AtomicU64,
saved_revision: AtomicU64,
}Expand description
Vanilla command storage for one Steel domain.
Fields§
§entries: SyncRwLock<FxHashMap<Identifier, NbtCompound>>§revision: AtomicU64§saved_revision: AtomicU64Implementations§
Source§impl CommandStorage
impl CommandStorage
fn from_persistent(persistent: PersistentCommandStorage) -> Result<Self>
Sourcepub(crate) fn get(&self, id: &Identifier) -> NbtCompound
pub(crate) fn get(&self, id: &Identifier) -> NbtCompound
Returns the compound stored at id, or an empty compound when absent.
Sourcepub(crate) fn set(&self, id: Identifier, contents: NbtCompound)
pub(crate) fn set(&self, id: Identifier, contents: NbtCompound)
Stores a compound, removing the key when the compound is empty.
Sourcepub(crate) fn keys(&self) -> Vec<Identifier>
pub(crate) fn keys(&self) -> Vec<Identifier>
Returns stored keys in stable resource-location order.
fn pending_save(&self) -> Option<CommandStorageSaveSnapshot>
fn mark_saved(&self, revision: u64)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CommandStorage
impl !RefUnwindSafe for CommandStorage
impl Send for CommandStorage
impl Sync for CommandStorage
impl Unpin for CommandStorage
impl UnsafeUnpin for CommandStorage
impl UnwindSafe for CommandStorage
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreWraps this value in an
Arc<SyncMutex<>>