pub struct DomainForm {
pub name: String,
pub fields: Vec<(String, DomainValue)>,
pub positional: Vec<DomainValue>,
}Expand description
A parsed #(name ...) form: a name, keyed fields, and positional values.
Fields§
§name: StringThe form name.
fields: Vec<(String, DomainValue)>Keyed key=value fields, in order.
positional: Vec<DomainValue>Positional (un-keyed) values, in order.
Implementations§
Source§impl DomainForm
impl DomainForm
Sourcepub fn field(&self, key: &str) -> Option<&DomainValue>
pub fn field(&self, key: &str) -> Option<&DomainValue>
The value of keyed field key, if present.
Sourcepub fn atom(&self, key: &str) -> Result<&str, DomainFormError>
pub fn atom(&self, key: &str) -> Result<&str, DomainFormError>
The atom string of keyed field key.
Sourcepub fn string(&self, key: &str) -> Result<&str, DomainFormError>
pub fn string(&self, key: &str) -> Result<&str, DomainFormError>
The string of keyed field key.
Sourcepub fn list(&self, key: &str) -> Result<&[DomainValue], DomainFormError>
pub fn list(&self, key: &str) -> Result<&[DomainValue], DomainFormError>
The list items of keyed field key.
Sourcepub fn form(&self, key: &str) -> Result<&DomainForm, DomainFormError>
pub fn form(&self, key: &str) -> Result<&DomainForm, DomainFormError>
The nested form of keyed field key.
Trait Implementations§
Source§impl Clone for DomainForm
impl Clone for DomainForm
Source§fn clone(&self) -> DomainForm
fn clone(&self) -> DomainForm
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 DomainForm
impl Debug for DomainForm
Source§impl PartialEq for DomainForm
impl PartialEq for DomainForm
Source§fn eq(&self, other: &DomainForm) -> bool
fn eq(&self, other: &DomainForm) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DomainForm
Auto Trait Implementations§
impl Freeze for DomainForm
impl RefUnwindSafe for DomainForm
impl Send for DomainForm
impl Sync for DomainForm
impl Unpin for DomainForm
impl UnsafeUnpin for DomainForm
impl UnwindSafe for DomainForm
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