pub struct Yaml {
config: YamlConfig,
}Expand description
Main YAML processing interface
Fields§
§config: YamlConfigImplementations§
Source§impl Yaml
impl Yaml
Sourcepub fn with_loader(loader_type: LoaderType) -> Self
pub fn with_loader(loader_type: LoaderType) -> Self
Create a new YAML processor with the specified loader type
Sourcepub const fn with_config(config: YamlConfig) -> Self
pub const fn with_config(config: YamlConfig) -> Self
Create a new YAML processor with custom configuration
Sourcepub const fn config(&self) -> &YamlConfig
pub const fn config(&self) -> &YamlConfig
Get the current configuration
Sourcepub const fn config_mut(&mut self) -> &mut YamlConfig
pub const fn config_mut(&mut self) -> &mut YamlConfig
Get a mutable reference to the configuration
Sourcepub fn load_all_str(&self, input: &str) -> Result<Vec<Value>>
pub fn load_all_str(&self, input: &str) -> Result<Vec<Value>>
Load all YAML documents from a string
Sourcepub fn load_all<R: Read>(&self, reader: R) -> Result<Vec<Value>>
pub fn load_all<R: Read>(&self, reader: R) -> Result<Vec<Value>>
Load all YAML documents from a reader
Sourcepub fn dump<W: Write>(&self, value: &Value, writer: W) -> Result<()>
pub fn dump<W: Write>(&self, value: &Value, writer: W) -> Result<()>
Dump a YAML value to a writer
Sourcepub fn dump_all_str(&self, values: &[Value]) -> Result<String>
pub fn dump_all_str(&self, values: &[Value]) -> Result<String>
Dump all YAML documents to a string
Sourcepub fn dump_all<W: Write>(&self, values: &[Value], writer: W) -> Result<()>
pub fn dump_all<W: Write>(&self, values: &[Value], writer: W) -> Result<()>
Dump all YAML documents to a writer
Sourcepub fn load_str_with_comments(&self, input: &str) -> Result<CommentedValue>
pub fn load_str_with_comments(&self, input: &str) -> Result<CommentedValue>
Load YAML from a string with comment preservation (RoundTrip mode only)
Sourcepub fn dump_str_with_comments(&self, value: &CommentedValue) -> Result<String>
pub fn dump_str_with_comments(&self, value: &CommentedValue) -> Result<String>
Dump a CommentedValue to a string, preserving comments
Sourcepub fn dump_with_comments<W: Write>(
&self,
value: &CommentedValue,
writer: W,
) -> Result<()>
pub fn dump_with_comments<W: Write>( &self, value: &CommentedValue, writer: W, ) -> Result<()>
Dump a CommentedValue to a writer, preserving comments
Sourcepub fn validate_with_schema(&self, value: &Value, schema: &Schema) -> Result<()>
pub fn validate_with_schema(&self, value: &Value, schema: &Schema) -> Result<()>
Validate a YAML value against a schema
Sourcepub fn load_str_with_schema(
&self,
input: &str,
schema: &Schema,
) -> Result<Value>
pub fn load_str_with_schema( &self, input: &str, schema: &Schema, ) -> Result<Value>
Load and validate YAML from a string with schema validation
Sourcepub fn load_all_str_with_schema(
&self,
input: &str,
schema: &Schema,
) -> Result<Vec<Value>>
pub fn load_all_str_with_schema( &self, input: &str, schema: &Schema, ) -> Result<Vec<Value>>
Load and validate all YAML documents from a string with schema validation
fn parse_yaml_string(&self, input: &str) -> Result<Value>
fn parse_yaml_documents(&self, input: &str) -> Result<Vec<Value>>
fn emit_yaml_value<W: Write>(&self, value: &Value, writer: W) -> Result<()>
fn parse_yaml_string_with_comments(&self, input: &str) -> Result<CommentedValue>
fn emit_commented_value<W: Write>( &self, value: &CommentedValue, writer: W, ) -> Result<()>
fn emit_yaml_documents<W: Write>( &self, values: &[Value], writer: W, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Yaml
impl RefUnwindSafe for Yaml
impl Send for Yaml
impl Sync for Yaml
impl Unpin for Yaml
impl UnwindSafe for Yaml
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more