pub struct Bucket {
pub name: String,
pub entries: HashMap<String, Vec<u8>>,
pub write_count: u64,
}Expand description
A single named storage bucket.
Fields§
§name: String§entries: HashMap<String, Vec<u8>>§write_count: u64Implementations§
Source§impl Bucket
impl Bucket
pub fn new(name: &str) -> Self
pub fn put(&mut self, key: &str, data: Vec<u8>)
pub fn get(&self, key: &str) -> Option<&[u8]>
pub fn remove(&mut self, key: &str) -> bool
pub fn contains(&self, key: &str) -> bool
pub fn entry_count(&self) -> usize
pub fn total_bytes(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bucket
impl RefUnwindSafe for Bucket
impl Send for Bucket
impl Sync for Bucket
impl Unpin for Bucket
impl UnsafeUnpin for Bucket
impl UnwindSafe for Bucket
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