pub struct YamlPatch { /* private fields */ }Expand description
A parsed sequence of RFC 6902-style operations over YAML values.
Implementations§
Source§impl YamlPatch
impl YamlPatch
Sourcepub fn new(operations: Vec<YamlPatchOperation>) -> YamlPatch
pub fn new(operations: Vec<YamlPatchOperation>) -> YamlPatch
Creates a patch from programmatically constructed operations.
Sourcepub fn parse(input: &str) -> Result<YamlPatch, YamlPatchError>
pub fn parse(input: &str) -> Result<YamlPatch, YamlPatchError>
Parses a YAML or JSON patch document.
§Errors
Returns an error when the source is invalid YAML or does not have the required sequence-of-operation-mappings shape.
Sourcepub fn parse_owned(input: String) -> Result<YamlPatch, YamlPatchError>
pub fn parse_owned(input: String) -> Result<YamlPatch, YamlPatchError>
Parses an owned YAML or JSON patch document without first copying it.
§Errors
Returns an error under the same conditions as Self::parse.
Sourcepub fn operations(&self) -> &[YamlPatchOperation]
pub fn operations(&self) -> &[YamlPatchOperation]
Returns the operations in application order.
Sourcepub fn into_operations(self) -> Vec<YamlPatchOperation>
pub fn into_operations(self) -> Vec<YamlPatchOperation>
Consumes this patch and returns its operations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for YamlPatch
impl RefUnwindSafe for YamlPatch
impl Send for YamlPatch
impl Sync for YamlPatch
impl Unpin for YamlPatch
impl UnsafeUnpin for YamlPatch
impl UnwindSafe for YamlPatch
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