Struct Message View
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
Shared read-only view of a request item, response output, or instructions.
Implementations
impl<'a> MessageView<'a>
impl<'a> MessageView<'a>
root
pub fn root(self) -> ContentRoot
Normalized root of this selection, including when it contains no parts.
retain
pub fn retain(self) -> RetainedContent
Copy the selected source for lazy traversal. For output, retain only the response message and tool calls. Parts and eligible text are read on demand.
source
pub fn source(self) -> ContentSource<'a>
Borrow the backing normalized item so callers can retain selected storage.
parts
pub fn parts(self) -> impl Iterator<Item = ContentEntry<'a>> + 'a
Enumerate content in normalized array order, then separate tool calls.
Tool-result messages yield one result containing the entire payload. Original provider ordering between separate fields is not recoverable.
text_parts
pub fn text_parts(self) -> impl Iterator<Item = &'a str> + 'a
Iterate explicit text/refusal strings, including known native fallbacks.
Tool payloads, media, reasoning, and arbitrary nested JSON are excluded.
text
pub fn text(self) -> Option<Cow<'a, str>>
Borrow a single text part, or join multiple parts with newlines.
Empty strings and whitespace are preserved. No eligible parts yields None.
impl MessageView<'_>
impl MessageView<'_>
snapshot
pub fn snapshot(self) -> ContentSnapshot
Copy selected typed content and eligible text into an owned transport snapshot.
Trait Implementations
impl<'a> Clone for MessageView<'a>
impl<'a> Clone for MessageView<'a>
clone
fn clone(&self) -> MessageView<'a>
clone_from
fn clone_from(&mut self, source: &Self)
impl<'a> Debug for MessageView<'a>
impl<'a> Debug for MessageView<'a>
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl<'a> Copy for MessageView<'a>
impl<'a> Copy for MessageView<'a>