pub struct Table { /* private fields */ }Expand description
One table of a document, read against its Shape: the values it holds, the tables inside
it and its arrays of tables.
Every reader answers None (or no entries) for a key that was missing or unreadable, so a
broken document is read exactly as far as it is readable.
Implementations§
Source§impl Table
impl Table
Sourcepub fn text(&self, key: &str) -> Option<&str>
pub fn text(&self, key: &str) -> Option<&str>
The text under key, declared with ValueKind::text or ValueKind::choice.
Sourcepub fn integer(&self, key: &str) -> Option<i64>
pub fn integer(&self, key: &str) -> Option<i64>
The number under key, declared with ValueKind::integer.
Sourcepub fn flag(&self, key: &str) -> Option<bool>
pub fn flag(&self, key: &str) -> Option<bool>
The true or false under key, declared with ValueKind::flag.
Sourcepub fn table(&self, key: &str) -> Option<&Table>
pub fn table(&self, key: &str) -> Option<&Table>
The table key holds, declared with Shape::table.
Sourcepub fn entries(&self, key: &str) -> &[Table]
pub fn entries(&self, key: &str) -> &[Table]
The entries key holds, declared with Shape::entries; empty when the document lists
none. The order is the file’s own.
Sourcepub fn location(&self, key: &str) -> Option<&Location>
pub fn location(&self, key: &str) -> Option<&Location>
Where key was written, so an application can report a problem only it can see — a name
no file system accepts, a date the calendar does not have — at the place the user wrote.
Sourcepub fn value_location(&self, key: &str) -> Option<&Location>
pub fn value_location(&self, key: &str) -> Option<&Location>
Where the value of key was written: 8 in mode = "halb" is the column of "halb",
not of mode. This is the place the document’s own diagnostics point at when a value
has the wrong type or is not one of its choices, so an application that reports its own
findings here lands on the same column. None when the key was missing or unreadable.
Trait Implementations§
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more