pub struct DataflowId(/* private fields */);Expand description
The identity of a running dataflow.
Minted by the coordinator at astrs start and carried by every
subsequent control message about that dataflow. It also names the
shared-memory segments of its nodes ({dataflow_id}/{node_id}/ {generation}, blueprint §6.2), which is why a stale segment is always
attributable.
§Examples
use astrs_wire::DataflowId;
let id = DataflowId::generate();
let text = id.to_string();
assert_eq!(text.parse::<DataflowId>()?, id);Implementations§
Source§impl DataflowId
impl DataflowId
Sourcepub const NIL: DataflowId
pub const NIL: DataflowId
The all-zero identifier.
A sentinel for “not yet assigned”; never returned by
DataflowId::generate.
Sourcepub fn generate() -> DataflowId
pub fn generate() -> DataflowId
Mints a fresh dataflow id using UUID v7 (time-ordered).
§Examples
use astrs_wire::DataflowId;
let id = DataflowId::generate();
assert_ne!(id, DataflowId::NIL);Sourcepub const fn from_uuid(uuid: Uuid) -> DataflowId
pub const fn from_uuid(uuid: Uuid) -> DataflowId
Wraps an existing Uuid as a dataflow id.
Sourcepub const fn from_u128(value: u128) -> DataflowId
pub const fn from_u128(value: u128) -> DataflowId
Builds an identifier from a 128-bit integer.
Deterministic — used by tests and by the protocol snapshot, which must produce byte-identical samples on every run.
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> DataflowId
pub const fn from_bytes(bytes: [u8; 16]) -> DataflowId
Builds an identifier from its sixteen wire bytes.
Trait Implementations§
Source§impl Clone for DataflowId
impl Clone for DataflowId
Source§fn clone(&self) -> DataflowId
fn clone(&self) -> DataflowId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DataflowId
Source§impl Debug for DataflowId
impl Debug for DataflowId
Source§impl<Context> Decode<Context> for DataflowId
impl<Context> Decode<Context> for DataflowId
Source§impl<'de> Deserialize<'de> for DataflowId
impl<'de> Deserialize<'de> for DataflowId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataflowId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataflowId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DataflowId
impl Display for DataflowId
Source§impl Encode for DataflowId
impl Encode for DataflowId
impl Eq for DataflowId
Source§impl From<Uuid> for DataflowId
impl From<Uuid> for DataflowId
Source§fn from(uuid: Uuid) -> DataflowId
fn from(uuid: Uuid) -> DataflowId
Converts to this type from the input type.
Source§impl FromStr for DataflowId
impl FromStr for DataflowId
Source§impl Hash for DataflowId
impl Hash for DataflowId
Source§impl Ord for DataflowId
impl Ord for DataflowId
Source§fn cmp(&self, other: &DataflowId) -> Ordering
fn cmp(&self, other: &DataflowId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DataflowId
impl PartialEq for DataflowId
Source§impl PartialOrd for DataflowId
impl PartialOrd for DataflowId
Source§impl Serialize for DataflowId
impl Serialize for DataflowId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for DataflowId
Auto Trait Implementations§
impl Freeze for DataflowId
impl RefUnwindSafe for DataflowId
impl Send for DataflowId
impl Sync for DataflowId
impl Unpin for DataflowId
impl UnsafeUnpin for DataflowId
impl UnwindSafe for DataflowId
Blanket Implementations§
impl<T> Allocation for T
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