Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

brokkr-agent::utils Rust

Functions

brokkr-agent::utils::multidoc_deserialize

pub

#![allow(unused)]
fn main() {
fn multidoc_deserialize (multi_doc_str : & str) -> Result < Vec < serde_yaml :: Value > , Box < dyn Error > >
}

Deserializes a multi-document YAML string into a vector of YAML values.

Parameters:

NameTypeDescription
multi_doc_str-String containing multiple YAML documents

Returns:

  • Result<Vec<serde_yaml::Value>, Box<dyn Error>> - Vector of parsed YAML values or error
Source
#![allow(unused)]
fn main() {
pub fn multidoc_deserialize(multi_doc_str: &str) -> Result<Vec<serde_yaml::Value>, Box<dyn Error>> {
    let mut docs = vec![];
    for d in serde_yaml::Deserializer::from_str(multi_doc_str) {
        docs.push(serde_yaml::Value::deserialize(d)?);
    }
    Ok(docs)
}
}