pub struct SplitDescriptor {
pub objects: Vec<DescriptorObject>,
/* private fields */
}Expand description
The opaque payload carried in a
SplitSpec::descriptor: the
split’s member objects, in listing order.
The encoding is versioned JSON (DESCRIPTOR_VERSION); member order is
meaningful (composite offsets index into it). Out-of-process producers —
an event-notification planner, a single-shot invocation minting one
split from an S3 event — construct via SplitDescriptor::new (which
stamps the version; encode refuses anything
else) and mint ids with split_id_for, which together are the whole
cross-process contract. Fields are freely readable.
Fields§
§objects: Vec<DescriptorObject>Member objects, in listing (and therefore read) order.
Implementations§
Source§impl SplitDescriptor
impl SplitDescriptor
Sourcepub fn new(objects: Vec<DescriptorObject>) -> SplitDescriptor
pub fn new(objects: Vec<DescriptorObject>) -> SplitDescriptor
Build a descriptor over objects (listing order — ordinals index
into it), stamped with the current DESCRIPTOR_VERSION. The only
way to construct one; encode refuses
any other version.
Sourcepub fn version(&self) -> u32
pub fn version(&self) -> u32
The encoding version this descriptor was constructed (or decoded) under.
Sourcepub fn encode(&self) -> Result<Vec<u8>, CoordinationError>
pub fn encode(&self) -> Result<Vec<u8>, CoordinationError>
Encode to the versioned wire form.
§Errors
Fatal when the descriptor’s
version is not DESCRIPTOR_VERSION — a descriptor written under a
wrong version fails pipeline-fatal on every worker that leases it.
Sourcepub fn decode(bytes: &[u8]) -> Result<SplitDescriptor, CoordinationError>
pub fn decode(bytes: &[u8]) -> Result<SplitDescriptor, CoordinationError>
Decode a descriptor, probing the version first.
§Errors
Fatal when the bytes do not parse
or were written under a different DESCRIPTOR_VERSION — a worker
must never guess at an incompatible descriptor.
Trait Implementations§
Source§impl Clone for SplitDescriptor
impl Clone for SplitDescriptor
Source§fn clone(&self) -> SplitDescriptor
fn clone(&self) -> SplitDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SplitDescriptor
impl Debug for SplitDescriptor
Source§impl<'de> Deserialize<'de> for SplitDescriptor
impl<'de> Deserialize<'de> for SplitDescriptor
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>,
impl Eq for SplitDescriptor
Source§impl PartialEq for SplitDescriptor
impl PartialEq for SplitDescriptor
Source§impl Serialize for SplitDescriptor
impl Serialize for SplitDescriptor
impl StructuralPartialEq for SplitDescriptor
Auto Trait Implementations§
impl Freeze for SplitDescriptor
impl RefUnwindSafe for SplitDescriptor
impl Send for SplitDescriptor
impl Sync for SplitDescriptor
impl Unpin for SplitDescriptor
impl UnsafeUnpin for SplitDescriptor
impl UnwindSafe for SplitDescriptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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