Struct atuin_common::record::Record
source · pub struct Record<Data> {
pub id: RecordId,
pub host: HostId,
pub parent: Option<RecordId>,
pub timestamp: u64,
pub version: String,
pub tag: String,
pub data: Data,
}Expand description
A single record stored inside of our local database
Fields§
§id: RecordIda unique ID
host: HostIdThe unique ID of the host.
parent: Option<RecordId>The ID of the parent entry
timestamp: u64The creation time in nanoseconds since unix epoch
version: StringThe version the data in the entry conforms to
tag: StringThe type of data we are storing here. Eg, “history”
data: DataSome data. This can be anything you wish to store. Use the tag field to know how to handle it.
Implementations§
source§impl<Data> Record<Data>
impl<Data> Record<Data>
sourcepub fn builder() -> RecordBuilder<Data, ((), (), (), (), (), (), ())>
pub fn builder() -> RecordBuilder<Data, ((), (), (), (), (), (), ())>
Create a builder for building Record.
On the builder, call .id(...)(optional), .host(...), .parent(...)(optional), .timestamp(...)(optional), .version(...), .tag(...), .data(...) to set the values of the fields.
Finally, call .build() to create the instance of Record.
source§impl Record<DecryptedData>
impl Record<DecryptedData>
pub fn encrypt<E: Encryption>(self, key: &[u8; 32]) -> Record<EncryptedData>
source§impl Record<EncryptedData>
impl Record<EncryptedData>
pub fn decrypt<E: Encryption>( self, key: &[u8; 32] ) -> Result<Record<DecryptedData>>
pub fn re_encrypt<E: Encryption>( self, old_key: &[u8; 32], new_key: &[u8; 32] ) -> Result<Record<EncryptedData>>
Trait Implementations§
source§impl<'de, Data> Deserialize<'de> for Record<Data>where
Data: Deserialize<'de>,
impl<'de, Data> Deserialize<'de> for Record<Data>where
Data: Deserialize<'de>,
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<Data: PartialEq> PartialEq for Record<Data>
impl<Data: PartialEq> PartialEq for Record<Data>
impl<Data> StructuralPartialEq for Record<Data>
Auto Trait Implementations§
impl<Data> RefUnwindSafe for Record<Data>where
Data: RefUnwindSafe,
impl<Data> Send for Record<Data>where
Data: Send,
impl<Data> Sync for Record<Data>where
Data: Sync,
impl<Data> Unpin for Record<Data>where
Data: Unpin,
impl<Data> UnwindSafe for Record<Data>where
Data: UnwindSafe,
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