pub struct KwebManager { /* private fields */ }Expand description
Cloneable sole owner of one live Kweb database handle.
Implementations§
Source§impl KwebManager
impl KwebManager
Sourcepub fn open(
database: KwebDb,
receipt_database: impl AsRef<Path>,
) -> Result<Self>
pub fn open( database: KwebDb, receipt_database: impl AsRef<Path>, ) -> Result<Self>
Takes ownership of an open Kweb database and opens its receipt lane.
Sourcepub fn get_node_history(&self, id: NodeId) -> Result<NodeHistory>
pub fn get_node_history(&self, id: NodeId) -> Result<NodeHistory>
Loads one node’s complete visible history.
Sourcepub fn get_object(&self, id: ObjectId) -> Result<Vec<u8>>
pub fn get_object(&self, id: ObjectId) -> Result<Vec<u8>>
Loads the exact opaque bytes of one Kweb object.
Sourcepub fn get_object_with_provenance(
&self,
id: ObjectId,
) -> Result<(Vec<u8>, Provenance)>
pub fn get_object_with_provenance( &self, id: ObjectId, ) -> Result<(Vec<u8>, Provenance)>
Loads exact bytes and provenance from the signed creating Kweb transaction.
Sourcepub fn create_provenance(&self, request: CreateProvenance) -> Result<ObjectId>
pub fn create_provenance(&self, request: CreateProvenance) -> Result<ObjectId>
Idempotently stores one application provenance envelope.
Sourcepub fn create_node(&self, request: NodeWrite) -> Result<Node>
pub fn create_node(&self, request: NodeWrite) -> Result<Node>
Idempotently creates a node without object attachments.
Sourcepub fn update_node(&self, id: NodeId, request: NodeWrite) -> Result<Node>
pub fn update_node(&self, id: NodeId, request: NodeWrite) -> Result<Node>
Idempotently updates ordinary node fields while retaining its objects.
Sourcepub fn store_object(
&self,
provenance: Provenance,
bytes: Vec<u8>,
) -> Result<ObjectId>
pub fn store_object( &self, provenance: Provenance, bytes: Vec<u8>, ) -> Result<ObjectId>
Stores exact opaque object bytes in one Kweb transaction.
Sourcepub fn commit_session(&self, request: CommitRequest) -> Result<CommitReceipt>
pub fn commit_session(&self, request: CommitRequest) -> Result<CommitReceipt>
Atomically commits one complete session through kcode-commit-session.
Trait Implementations§
Source§impl Clone for KwebManager
impl Clone for KwebManager
Source§fn clone(&self) -> KwebManager
fn clone(&self) -> KwebManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for KwebManager
impl !UnwindSafe for KwebManager
impl Freeze for KwebManager
impl Send for KwebManager
impl Sync for KwebManager
impl Unpin for KwebManager
impl UnsafeUnpin for KwebManager
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