pub struct SourceMetadata { /* private fields */ }Expand description
What is known about one source.
Implementations§
Source§impl SourceMetadata
impl SourceMetadata
Sourcepub fn with<I, V>(self, field: SourceField, values: I) -> Self
pub fn with<I, V>(self, field: SourceField, values: I) -> Self
States field as read completely, holding values.
Values are kept sorted and distinct; blank ones state nothing and are dropped, so a field of only blank values is read and empty. Stating a field again replaces it.
Sourcepub fn values(&self, field: SourceField) -> Option<&[String]>
pub fn values(&self, field: SourceField) -> Option<&[String]>
The values of field, sorted and distinct; None when it was never
read.
Sourcepub fn fields(&self) -> impl Iterator<Item = (SourceField, &[String])>
pub fn fields(&self) -> impl Iterator<Item = (SourceField, &[String])>
Every read field with its values.
Sourcepub fn merged(self, other: Self) -> Result<Self, SourceField>
pub fn merged(self, other: Self) -> Result<Self, SourceField>
Both statements together.
§Errors
The first field both state with different values: two readers of one source disagree, and neither is taken.
Trait Implementations§
Source§impl Clone for SourceMetadata
impl Clone for SourceMetadata
Source§impl Debug for SourceMetadata
impl Debug for SourceMetadata
Source§impl Default for SourceMetadata
impl Default for SourceMetadata
impl Eq for SourceMetadata
Source§impl PartialEq for SourceMetadata
impl PartialEq for SourceMetadata
impl StructuralPartialEq for SourceMetadata
Auto Trait Implementations§
impl Freeze for SourceMetadata
impl RefUnwindSafe for SourceMetadata
impl Send for SourceMetadata
impl Sync for SourceMetadata
impl Unpin for SourceMetadata
impl UnsafeUnpin for SourceMetadata
impl UnwindSafe for SourceMetadata
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