pub(crate) struct Annotated {
pub(crate) comment: Option<Comment>,
pub(crate) value: AnnotatedValue,
}Expand description
A value decorated with an optional comment.
Fields§
§comment: Option<Comment>Comment attached to this value by the author.
value: AnnotatedValueThe annotated value itself.
Implementations§
Source§impl Annotated
impl Annotated
Sourcepub(crate) fn validate(&self, format: Format) -> Result<(), DocumentError>
pub(crate) fn validate(&self, format: Format) -> Result<(), DocumentError>
Check that format can express this value and everything below it.
Backends still check what depends on content, such as a string that a literal block cannot reproduce.
§Errors
Returns the unsupported feature error for format, at the path of
the first value that needs a feature the format lacks.
Trait Implementations§
Source§impl TryFrom<&Value> for Annotated
impl TryFrom<&Value> for Annotated
Source§fn try_from(value: &Value) -> Result<Self, Self::Error>
fn try_from(value: &Value) -> Result<Self, Self::Error>
Decode a generic structured value into its annotation tree.
§Errors
Returns an error for malformed annotation markers, fields set more than once, a string style on a non string value, non finite numbers, and value kinds without a scalar counterpart.
Source§type Error = DocumentError
type Error = DocumentError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for Annotated
impl RefUnwindSafe for Annotated
impl Send for Annotated
impl Sync for Annotated
impl Unpin for Annotated
impl UnsafeUnpin for Annotated
impl UnwindSafe for Annotated
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