pub struct EncryptedNote {
pub(crate) id: NoteId,
pub(crate) encrypted_text: String,
pub(crate) data: String,
pub(crate) owner: String,
pub(crate) users: HashMap<String, PrincipalRule>,
pub(crate) locked: bool,
pub(crate) read_by: HashSet<String>,
pub(crate) created_at: u64,
pub(crate) updated_at: u64,
pub(crate) history: Vec<HistoryEntry>,
}
Fields§
§id: NoteId
§encrypted_text: String
§data: String
§owner: String
§users: HashMap<String, PrincipalRule>
Principals with whom this note is shared. Does not include the owner. Needed to be able to efficiently show in the UI with whom this note is shared.
locked: bool
§read_by: HashSet<String>
§created_at: u64
§updated_at: u64
§history: Vec<HistoryEntry>
Implementations§
Source§impl EncryptedNote
impl EncryptedNote
pub fn create(id: NoteId) -> Self
pub fn id(&self) -> NoteId
pub fn data(&self) -> String
pub fn read_by(&self) -> HashSet<String>
pub fn encrypted_text(&self) -> String
pub fn owner(&self) -> String
pub fn users(&self) -> HashMap<String, PrincipalRule>
pub fn locked(&self) -> bool
pub fn created_at(&self) -> u64
pub fn updated_at(&self) -> u64
pub fn history(&self) -> Vec<HistoryEntry>
pub fn add_reader(&mut self, user: &Option<String>, when: Option<u64>) -> bool
pub fn user_read(&self, user: &String) -> bool
pub fn remove_reader(&mut self, user: &Option<String>) -> bool
pub fn set_data(&mut self, data: String) -> bool
pub fn set_encrypted_text(&mut self, encrypted_text: String) -> bool
pub fn set_data_and_encrypted_text( &mut self, data: String, encrypted_text: String, ) -> bool
pub fn is_locked(&self) -> bool
Trait Implementations§
Source§impl CandidType for EncryptedNote
impl CandidType for EncryptedNote
Source§impl Clone for EncryptedNote
impl Clone for EncryptedNote
Source§fn clone(&self) -> EncryptedNote
fn clone(&self) -> EncryptedNote
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 Debug for EncryptedNote
impl Debug for EncryptedNote
Source§impl Default for EncryptedNote
impl Default for EncryptedNote
Source§impl<'de> Deserialize<'de> for EncryptedNote
impl<'de> Deserialize<'de> for EncryptedNote
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 PartialEq for EncryptedNote
impl PartialEq for EncryptedNote
Source§impl Storable for EncryptedNote
impl Storable for EncryptedNote
Source§fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
Converts bytes into an element.
§fn to_bytes_checked(&self) -> Cow<'_, [u8]>
fn to_bytes_checked(&self) -> Cow<'_, [u8]>
Like
to_bytes
, but includes additional checks to ensure the element’s serialized bytes
are within the element’s bounds.impl Eq for EncryptedNote
impl StructuralPartialEq for EncryptedNote
Auto Trait Implementations§
impl Freeze for EncryptedNote
impl RefUnwindSafe for EncryptedNote
impl Send for EncryptedNote
impl Sync for EncryptedNote
impl Unpin for EncryptedNote
impl UnwindSafe for EncryptedNote
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