pub struct StreamMetadata { /* private fields */ }Expand description
Full identity of a stream: id, media kind, direction, clock, and buffer policy.
This is the value other libraries inspect to learn a stream’s shape, and
the value publish_metadata_claims turns into runtime facts. It
round-trips to and from an Expr map (table_expr/from_table_expr)
and to constructor arguments (to_constructor_args/from_constructor_args).
Implementations§
Source§impl StreamMetadata
impl StreamMetadata
Sourcepub fn new(
id: Symbol,
media: StreamMedia,
direction: StreamDirection,
clock: Symbol,
buffer: BufferPolicy,
) -> Self
pub fn new( id: Symbol, media: StreamMedia, direction: StreamDirection, clock: Symbol, buffer: BufferPolicy, ) -> Self
Builds metadata from its id, media kind, direction, clock symbol, and buffer policy.
Sourcepub fn media(&self) -> StreamMedia
pub fn media(&self) -> StreamMedia
Returns the stream’s media kind.
Sourcepub fn direction(&self) -> StreamDirection
pub fn direction(&self) -> StreamDirection
Returns the stream’s flow direction.
Sourcepub fn buffer(&self) -> &BufferPolicy
pub fn buffer(&self) -> &BufferPolicy
Returns the stream’s buffer policy.
Sourcepub fn subject_ref(&self) -> Ref
pub fn subject_ref(&self) -> Ref
Returns the claim-store subject reference for this stream (its id as a symbol ref).
Sourcepub fn to_constructor_args(&self) -> Vec<Expr>
pub fn to_constructor_args(&self) -> Vec<Expr>
Encodes the metadata as the ordered constructor argument expressions
accepted by from_constructor_args.
Sourcepub fn from_constructor_args(args: Vec<Expr>) -> Result<Self>
pub fn from_constructor_args(args: Vec<Expr>) -> Result<Self>
Rebuilds metadata from the five constructor argument expressions
produced by to_constructor_args.
Returns an error when the argument count or any argument shape is wrong.
Sourcepub fn table_expr(&self) -> Expr
pub fn table_expr(&self) -> Expr
Encodes the metadata as a self-describing Expr map keyed by field
name (kind, id, media, direction, clock, buffer).
Sourcepub fn from_table_expr(expr: &Expr) -> Result<Self>
pub fn from_table_expr(expr: &Expr) -> Result<Self>
Rebuilds metadata from the Expr map produced by
table_expr.
Returns an error when the expression is not a map or a required field is missing or malformed.
Trait Implementations§
Source§impl Clone for StreamMetadata
impl Clone for StreamMetadata
Source§fn clone(&self) -> StreamMetadata
fn clone(&self) -> StreamMetadata
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 StreamMetadata
impl Debug for StreamMetadata
impl Eq for StreamMetadata
Source§impl PartialEq for StreamMetadata
impl PartialEq for StreamMetadata
Source§fn eq(&self, other: &StreamMetadata) -> bool
fn eq(&self, other: &StreamMetadata) -> bool
self and other values to be equal, and is used by ==.