pub enum Attribute {
Definition {
name: Name,
att_type: AttType,
default_decl: DefaultDecl,
source: EntitySource,
},
Reference(Reference),
Instance {
name: Name,
value: AttributeValue,
},
Required,
Implied,
Namespace {
prefix: Prefix,
uri: AttributeValue,
},
}
Variants§
Implementations§
Source§impl Attribute
impl Attribute
Sourcepub fn new(name: &str, value: &str) -> Self
pub fn new(name: &str, value: &str) -> Self
Useful for creating an attribute to match against in parsing specific tags.
See the ‘parse_element_with_specific_attribute_value’ example for more information.
Future use in writing XML files.
Note: this will not create attribute names that have prefixes
use nom_xml::attribute::Attribute;
let attr = Attribute::new("name","value");
pub fn parse_definition( input: &str, entity_references: Rc<RefCell<HashMap<(Name, EntitySource), EntityValue>>>, entity_source: EntitySource, ) -> IResult<&str, Attribute>
pub fn parse_qualified_definition( input: &str, entity_references: Rc<RefCell<HashMap<(Name, EntitySource), EntityValue>>>, entity_source: EntitySource, ) -> IResult<&str, Attribute>
pub fn parse_attvalue( input: &str, entity_references: Rc<RefCell<HashMap<(Name, EntitySource), EntityValue>>>, entity_source: EntitySource, ) -> IResult<&str, AttributeValue>
pub fn parse_attribute( input: &str, entity_references: Rc<RefCell<HashMap<(Name, EntitySource), EntityValue>>>, entity_source: EntitySource, ) -> IResult<&str, Attribute>
Trait Implementations§
Source§impl<'a> Parse<'a> for Attribute
impl<'a> Parse<'a> for Attribute
type Args = (Rc<RefCell<HashMap<(Name, EntitySource), EntityValue>>>, EntitySource)
type Output = Result<(&'a str, Attribute), Err<Error>>
fn parse(input: &'a str, args: Self::Args) -> Self::Output
fn is_char(c: char) -> bool
fn parse_char(input: &str) -> IResult<&str, char>
fn is_whitespace(c: char) -> bool
fn parse_multispace1(input: &str) -> IResult<&str, ()>
fn parse_multispace0(input: &str) -> IResult<&str, ()>
fn is_name_start_char(c: char) -> bool
fn is_name_char(c: char) -> bool
fn parse_name_char(input: &str) -> IResult<&str, char>
fn parse_name_start_char(input: &str) -> IResult<&str, char>
fn parse_nmtoken(input: &str) -> IResult<&str, String>
fn parse_nmtokens(input: &str) -> IResult<&str, Vec<String>>
fn parse_name(input: &str) -> IResult<&str, Name>
fn parse_names(input: &str) -> IResult<&str, Vec<Name>>
fn parse_eq(input: &str) -> IResult<&str, ()>
fn capture_span<O, F>( f: F, ) -> Box<dyn FnMut(&'a str) -> IResult<&'a str, (&'a str, O)> + 'a>
Source§impl<'a> ParseNamespace<'a> for Attribute
impl<'a> ParseNamespace<'a> for Attribute
fn parse_namespace_attribute_name(input: &str) -> IResult<&str, Name>
fn parse_prefixed_attribute_name(input: &str) -> IResult<&str, Name>
fn parse_non_colonized_name(input: &str) -> IResult<&str, String>
fn parse_non_colonized_name_char(input: &str) -> IResult<&str, char>
fn parse_non_colonized_name_start_char(input: &str) -> IResult<&str, char>
fn parse_qualified_name(input: &str) -> IResult<&str, Name>
fn parse_prefixed_name(input: &str) -> IResult<&str, Name>
impl Eq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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