pub struct LocatedValue { /* private fields */ }Expand description
A Value with its Location and an optional Comment.
Fields are private; build with LocatedValue::new and access through the provided
accessor methods. Display is compact by default; use {value:#} for a multiline dump
with @source:resource:line:column on the first line.
Implementations§
Source§impl LocatedValue
impl LocatedValue
Sourcepub fn new(
value: impl Into<Value>,
location: impl Into<Location>,
) -> LocatedValue
pub fn new( value: impl Into<Value>, location: impl Into<Location>, ) -> LocatedValue
Create a located value with an empty (default) comment.
pub fn value(&self) -> &Value
pub fn value_mut(&mut self) -> &mut Value
pub fn into_value(self) -> Value
pub fn with_value(self, value: impl Into<Value>) -> LocatedValue
pub fn set_value(&mut self, value: impl Into<Value>)
pub fn location(&self) -> &Location
pub fn location_mut(&mut self) -> &mut Location
pub fn with_location(self, location: impl Into<Location>) -> LocatedValue
pub fn set_location(&mut self, location: impl Into<Location>)
pub fn comment(&self) -> &Comment
pub fn comment_mut(&mut self) -> &mut Comment
pub fn with_comment(self, comment: Comment) -> LocatedValue
pub fn set_comment(&mut self, comment: Comment)
Trait Implementations§
Source§impl AsRef<Value> for LocatedValue
impl AsRef<Value> for LocatedValue
Source§impl Clone for LocatedValue
impl Clone for LocatedValue
Source§fn clone(&self) -> LocatedValue
fn clone(&self) -> LocatedValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocatedValue
impl Debug for LocatedValue
Source§impl Display for LocatedValue
impl Display for LocatedValue
Source§impl PartialEq for LocatedValue
impl PartialEq for LocatedValue
Source§fn eq(&self, other: &LocatedValue) -> bool
fn eq(&self, other: &LocatedValue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LocatedValue
Auto Trait Implementations§
impl Freeze for LocatedValue
impl RefUnwindSafe for LocatedValue
impl Send for LocatedValue
impl Sync for LocatedValue
impl Unpin for LocatedValue
impl UnsafeUnpin for LocatedValue
impl UnwindSafe for LocatedValue
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