pub struct Annotations { /* private fields */ }Expand description
A collection of protocol annotations with typed accessors.
Implementations§
Source§impl Annotations
impl Annotations
Sourcepub fn new() -> Annotations
pub fn new() -> Annotations
Create an empty annotation set.
Sourcepub fn single(annotation: ProtocolAnnotation) -> Annotations
pub fn single(annotation: ProtocolAnnotation) -> Annotations
Create from a single annotation.
Sourcepub fn from_vec(items: Vec<ProtocolAnnotation>) -> Annotations
pub fn from_vec(items: Vec<ProtocolAnnotation>) -> Annotations
Create from a vector of annotations.
Sourcepub fn from_dsl_entries(entries: &[DslAnnotationEntry]) -> Annotations
pub fn from_dsl_entries(entries: &[DslAnnotationEntry]) -> Annotations
Create from ordered raw DSL entries.
Entry order is preserved exactly. Known annotations are lowered to their
typed variants; unknown entries remain Custom.
pub fn from_dsl_map(map: &HashMap<String, String>) -> Annotations
pub fn dsl_map(&self) -> HashMap<String, String>
Sourcepub fn dsl_entries(&self) -> Vec<DslAnnotationEntry>
pub fn dsl_entries(&self) -> Vec<DslAnnotationEntry>
Return raw DSL entries in stable order.
Sourcepub fn push(&mut self, annotation: ProtocolAnnotation)
pub fn push(&mut self, annotation: ProtocolAnnotation)
Add an annotation.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ProtocolAnnotation>
pub fn iter(&self) -> impl Iterator<Item = &ProtocolAnnotation>
Iterate over annotations.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut ProtocolAnnotation>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut ProtocolAnnotation>
Iterate mutably over annotations.
Sourcepub fn find<F>(&self, f: F) -> Option<&ProtocolAnnotation>
pub fn find<F>(&self, f: F) -> Option<&ProtocolAnnotation>
Find the first annotation satisfying a predicate.
Sourcepub fn timed_choice(&self) -> Option<Duration>
pub fn timed_choice(&self) -> Option<Duration>
Get timed choice annotation if present.
Sourcepub fn has_timed_choice(&self) -> bool
pub fn has_timed_choice(&self) -> bool
Check if this has a timed choice annotation.
Sourcepub fn is_idempotent(&self) -> bool
pub fn is_idempotent(&self) -> bool
Check if marked as idempotent.
Sourcepub fn has_heartbeat(&self) -> bool
pub fn has_heartbeat(&self) -> bool
Check if has a heartbeat annotation.
Sourcepub fn heartbeat(&self) -> Option<(Duration, u32)>
pub fn heartbeat(&self) -> Option<(Duration, u32)>
Get heartbeat parameters if present (interval, on_missing_count).
Sourcepub fn has_runtime_timeout(&self) -> bool
pub fn has_runtime_timeout(&self) -> bool
Check if has a runtime timeout annotation.
Sourcepub fn runtime_timeout(&self) -> Option<Duration>
pub fn runtime_timeout(&self) -> Option<Duration>
Get runtime timeout duration if present.
Sourcepub fn has_parallel(&self) -> bool
pub fn has_parallel(&self) -> bool
Check if has a parallel annotation.
Sourcepub fn has_ordered(&self) -> bool
pub fn has_ordered(&self) -> bool
Check if has an ordered annotation.
Sourcepub fn has_min_responses(&self) -> bool
pub fn has_min_responses(&self) -> bool
Check if has a min_responses annotation.
Sourcepub fn min_responses(&self) -> Option<u32>
pub fn min_responses(&self) -> Option<u32>
Get min_responses value if present.
Sourcepub fn custom_values(&self, key: &str) -> Vec<&str>
pub fn custom_values(&self, key: &str) -> Vec<&str>
Get every custom annotation value for a key in source order.
Sourcepub fn merge(&mut self, other: &Annotations)
pub fn merge(&mut self, other: &Annotations)
Merge annotations from another set.
Trait Implementations§
Source§impl Clone for Annotations
impl Clone for Annotations
Source§fn clone(&self) -> Annotations
fn clone(&self) -> Annotations
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more