pub struct PersistedRecord {
pub offset: u64,
pub key: String,
pub payload: Arc<Bytes>,
pub appended_at: i64,
}Expand description
Durable form of one retained record.
payload persists as a JSON string rather than a byte array: the frame is
already UTF-8 JSON, and serde_json writes Vec<u8> as an array of
decimal integers, which inflates it roughly fourfold before compression and
compresses worse than the text it came from. Escaping costs a little; a
RawValue would cost nothing at all and is the upgrade if this ever shows
up in a profile.
Fields§
§offset: u64§key: String§payload: Arc<Bytes>§appended_at: i64Trait Implementations§
Source§impl Clone for PersistedRecord
impl Clone for PersistedRecord
Source§impl Debug for PersistedRecord
impl Debug for PersistedRecord
Source§impl<'de> Deserialize<'de> for PersistedRecord
impl<'de> Deserialize<'de> for PersistedRecord
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
Auto Trait Implementations§
impl Freeze for PersistedRecord
impl RefUnwindSafe for PersistedRecord
impl Send for PersistedRecord
impl Sync for PersistedRecord
impl Unpin for PersistedRecord
impl UnsafeUnpin for PersistedRecord
impl UnwindSafe for PersistedRecord
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