pub struct CdcEntry {
pub op: CdcOp,
pub key: String,
pub hash: Option<String>,
pub data: Option<Vec<u8>>,
pub meta: Option<String>,
}Expand description
A CDC entry ready to be written to the stream
Fields§
§op: CdcOpOperation type
key: StringObject ID (key)
hash: Option<String>Content hash for dedup (SHA256 of content) - only for PUT
data: Option<Vec<u8>>Compressed data - only for PUT
meta: Option<String>Metadata JSON - only for PUT
Implementations§
Source§impl CdcEntry
impl CdcEntry
Sourcepub fn put(
key: String,
hash: String,
content: &[u8],
content_type: &str,
version: u64,
updated_at: i64,
trace_parent: Option<String>,
) -> Self
pub fn put( key: String, hash: String, content: &[u8], content_type: &str, version: u64, updated_at: i64, trace_parent: Option<String>, ) -> Self
Create a PUT entry
Sourcepub fn to_redis_fields(&self) -> Vec<(&'static str, CdcFieldValue)>
pub fn to_redis_fields(&self) -> Vec<(&'static str, CdcFieldValue)>
Convert to Redis XADD field-value pairs Returns Vec of (field, value) where value is either String or bytes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CdcEntry
impl RefUnwindSafe for CdcEntry
impl Send for CdcEntry
impl Sync for CdcEntry
impl Unpin for CdcEntry
impl UnwindSafe for CdcEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more