pub struct StreamConfig {
pub target: StreamTarget,
pub append_newline: bool,
pub charset: String,
pub frame: StreamFrame,
pub size: Option<u64>,
}Expand description
Configuration parsed from a stream URI.
Format: stream:out|err|in?appendNewline=true&charset=utf-8&frame=line[&size=N]
Fields§
§target: StreamTargetStream target (the path portion of the URI).
append_newline: boolWhen true (default), append a trailing newline to each body written
to out/err.
charset: StringCharset for the stream. Only utf-8 is supported in v1.
frame: StreamFrameFraming mode. Default: line.
size: Option<u64>Fixed frame size in bytes. Required (and must be greater than 0)
when frame = fixed.
Implementations§
Source§impl StreamConfig
impl StreamConfig
Sourcepub fn parse_uri_components(parts: UriComponents) -> Result<Self, CamelError>
pub fn parse_uri_components(parts: UriComponents) -> Result<Self, CamelError>
Parse URI components into this config.
Call this from your custom UriConfig::from_components implementation.
Sourcepub fn uri_options() -> Vec<UriOption>
pub fn uri_options() -> Vec<UriOption>
Generated URI option definitions, one per #[uri_param] field.
The path field is excluded.
Sourcepub fn metadata() -> ComponentMetadata
pub fn metadata() -> ComponentMetadata
Generated ComponentMetadata, built from the
#[uri_config(metadata(..))] attribute plus the derived
uri_options().
Source§impl StreamConfig
impl StreamConfig
Sourcepub fn validate(&self) -> Result<(), CamelError>
pub fn validate(&self) -> Result<(), CamelError>
Validate the configuration without consuming self.
The target needs no check here: StreamTarget is a closed enum whose
FromStr rejects unknown paths, so any constructed config already
holds a valid target by construction.