pub struct OperatorCheckpoint {
pub state_b64: Option<String>,
pub external: bool,
pub external_offset: u64,
pub external_length: u64,
}Expand description
Serialized operator state stored in the manifest.
Fields§
§state_b64: Option<String>Base64-encoded binary state (for small payloads inlined in JSON).
external: boolIf true, state is stored externally in the state.bin sidecar file.
external_offset: u64Byte offset into the state.bin file (if external).
external_length: u64Byte length of the state in the state.bin file (if external).
Implementations§
Source§impl OperatorCheckpoint
impl OperatorCheckpoint
Sourcepub fn inline(data: &[u8]) -> Self
pub fn inline(data: &[u8]) -> Self
Creates an inline operator checkpoint from raw bytes.
The bytes are base64-encoded for JSON storage.
Sourcepub fn external(offset: u64, length: u64) -> Self
pub fn external(offset: u64, length: u64) -> Self
Creates an external reference to state in the sidecar file.
Sourcepub fn decode_inline(&self) -> Option<Vec<u8>>
pub fn decode_inline(&self) -> Option<Vec<u8>>
Decodes the inline state, returning the raw bytes.
Returns None if the state is external, no inline data is present,
or if the base64 data is corrupted (logs a warning in that case).
Sourcepub fn try_decode_inline(&self) -> Result<Option<Vec<u8>>, String>
pub fn try_decode_inline(&self) -> Result<Option<Vec<u8>>, String>
Decodes the inline state, returning a Result for callers that need
to distinguish between “no inline state” and “corrupted state”.
Returns Ok(None) if no inline data is present (external or absent).
Returns Ok(Some(bytes)) on successful decode.
§Errors
Returns Err if base64 data is present but corrupted.
Sourcepub fn from_bytes(
data: &[u8],
threshold: usize,
current_offset: u64,
) -> (Self, Option<Vec<u8>>)
pub fn from_bytes( data: &[u8], threshold: usize, current_offset: u64, ) -> (Self, Option<Vec<u8>>)
Creates an OperatorCheckpoint from raw bytes using a size threshold.
If data.len() <= threshold, the state is inlined as base64.
If data.len() > threshold, the state is marked as external with the
given offset and length, and the raw data is returned for sidecar storage.
§Arguments
data— Raw operator state bytesthreshold— Maximum size in bytes for inline storagecurrent_offset— Byte offset into the sidecar file for this blob
§Returns
A tuple of the checkpoint entry and optional raw data for the sidecar.
Trait Implementations§
Source§impl Clone for OperatorCheckpoint
impl Clone for OperatorCheckpoint
Source§fn clone(&self) -> OperatorCheckpoint
fn clone(&self) -> OperatorCheckpoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OperatorCheckpoint
impl Debug for OperatorCheckpoint
Source§impl<'de> Deserialize<'de> for OperatorCheckpoint
impl<'de> Deserialize<'de> for OperatorCheckpoint
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>,
Source§impl PartialEq for OperatorCheckpoint
impl PartialEq for OperatorCheckpoint
Source§impl Serialize for OperatorCheckpoint
impl Serialize for OperatorCheckpoint
impl Eq for OperatorCheckpoint
impl StructuralPartialEq for OperatorCheckpoint
Auto Trait Implementations§
impl Freeze for OperatorCheckpoint
impl RefUnwindSafe for OperatorCheckpoint
impl Send for OperatorCheckpoint
impl Sync for OperatorCheckpoint
impl Unpin for OperatorCheckpoint
impl UnsafeUnpin for OperatorCheckpoint
impl UnwindSafe for OperatorCheckpoint
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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