pub struct RootBucket(pub Principal);
Expand description
A root bucket.
Every token contract has a root bucket. This bucket is used for the main inserting transactions into history, and organizing fetching the bucket that corresponds to a given transaction.
A root bucket implements the same interface as Bucket
, but with 3 additional methods.
Use RootBucket
’s Into<Bucket>
implementation to use a RootBucket
as a Bucket
.
Tuple Fields§
§0: Principal
Implementations§
Source§impl RootBucket
impl RootBucket
Sourcepub async fn get_bucket_for(
&self,
id: u64,
) -> Result<Bucket, (RejectionCode, String)>
pub async fn get_bucket_for( &self, id: u64, ) -> Result<Bucket, (RejectionCode, String)>
Returns a bucket that be used to query for the given transaction ID.
Sourcepub async fn insert(
&self,
event: &IndefiniteEvent,
) -> Result<u64, (RejectionCode, String)>
pub async fn insert( &self, event: &IndefiniteEvent, ) -> Result<u64, (RejectionCode, String)>
Inserts the given transaction and returns it’s issued transaction ID.
Sourcepub async fn insert_many(
&self,
events: &[IndefiniteEvent],
) -> Result<u64, (RejectionCode, String)>
pub async fn insert_many( &self, events: &[IndefiniteEvent], ) -> Result<u64, (RejectionCode, String)>
Inserts the given transactions.
Trait Implementations§
Source§impl CandidType for RootBucket
impl CandidType for RootBucket
Source§impl Clone for RootBucket
impl Clone for RootBucket
Source§fn clone(&self) -> RootBucket
fn clone(&self) -> RootBucket
Returns a copy 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<'de> Deserialize<'de> for RootBucket
impl<'de> Deserialize<'de> for RootBucket
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<RootBucket> for Bucket
impl From<RootBucket> for Bucket
Source§fn from(root: RootBucket) -> Self
fn from(root: RootBucket) -> Self
Converts to this type from the input type.
Source§impl Serialize for RootBucket
impl Serialize for RootBucket
impl Copy for RootBucket
Auto Trait Implementations§
impl Freeze for RootBucket
impl RefUnwindSafe for RootBucket
impl Send for RootBucket
impl Sync for RootBucket
impl Unpin for RootBucket
impl UnwindSafe for RootBucket
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