pub struct Snapshot { /* private fields */ }Expand description
The IDs of one world, each with a fingerprint of its content.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn from_world(world: &World, limits: &Limits) -> Result<Self, Error>
pub fn from_world(world: &World, limits: &Limits) -> Result<Self, Error>
The snapshot of a loaded source tree. The world is already in
memory, so limits bound the snapshot built from it.
§Errors
Returns Error::TooManyIds if the world has more IDs than
limits allow, or Error::Invalid if a document of the world
cannot be read again, which a world that loaded never has.
Sourcepub fn from_pack(pack: &Pack, limits: &Limits) -> Result<Self, Error>
pub fn from_pack(pack: &Pack, limits: &Limits) -> Result<Self, Error>
The snapshot of a content pack. The pack is fully verified first,
as Pack::verify does, and its IDs are then read through
Pack::visit_identities one row at a time; reading stops as soon
as the pack has more IDs than limits allow.
§Errors
Returns Error::TooManyIds past the limit, or Error::Pack if
the pack does not verify or SQLite fails.
Sourcepub fn object_plane(&self, uid: &str) -> Option<&str>
pub fn object_plane(&self, uid: &str) -> Option<&str>
The plane the object with uid is on.
Trait Implementations§
impl Eq for Snapshot
impl StructuralPartialEq for Snapshot
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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