pub struct SourceRef {
pub source_id: String,
pub line: Option<u32>,
pub column: Option<u32>,
pub byte_offset: Option<u64>,
pub record: Option<String>,
pub field: Option<String>,
pub raw_token: Option<String>,
}Expand description
A pointer into one source artifact: where a canonical field came from.
Fields§
§source_id: String§line: Option<u32>§column: Option<u32>§byte_offset: Option<u64>Byte offset, for binary sources.
record: Option<String>Record / section / object type, e.g. bus.
field: Option<String>Canonical field / property name, e.g. vm.
raw_token: Option<String>Raw token / value, when safe to embed.
Implementations§
Source§impl SourceRef
impl SourceRef
Sourcepub fn new(source_id: impl Into<String>) -> Self
pub fn new(source_id: impl Into<String>) -> Self
Create a reference to a declared source artifact.
Sourcepub fn with_field(self, field: impl Into<String>) -> Self
pub fn with_field(self, field: impl Into<String>) -> Self
Set the field or property name.
Sourcepub fn with_record(self, record: impl Into<String>) -> Self
pub fn with_record(self, record: impl Into<String>) -> Self
Set the source record, section, or object type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SourceRef
impl<'de> Deserialize<'de> for SourceRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SourceRef
impl StructuralPartialEq for SourceRef
Auto Trait Implementations§
impl Freeze for SourceRef
impl RefUnwindSafe for SourceRef
impl Send for SourceRef
impl Sync for SourceRef
impl Unpin for SourceRef
impl UnsafeUnpin for SourceRef
impl UnwindSafe for SourceRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more