Struct org_rust_parser::Attr
source · pub struct Attr<'a> {
pub key: &'a str,
pub val: &'a str,
}
Expand description
Representation of attributes that can be attached to Node
s.
Arbitrary nodes can be assigned attributes via Affiliated
keywords:
use org_rust_parser as org_parser;
use org_parser::{node_in_pool, Expr, Node, parse_org, Attr};
let parsed = parse_org(r"
#+attr_html: :one 1 :two 2
* one
");
let heading_node = &node_in_pool!(parsed, Heading).unwrap().attrs["html"];
assert_eq!(
heading_node,
&vec![
Attr {
key: "one",
val: "1"
},
Attr {
key: "two",
val: "2"
},
]
);
For
Fields§
§key: &'a str
§val: &'a str
Trait Implementations§
source§impl<'a> PartialEq for Attr<'a>
impl<'a> PartialEq for Attr<'a>
impl<'a> Copy for Attr<'a>
impl<'a> StructuralPartialEq for Attr<'a>
Auto Trait Implementations§
impl<'a> Freeze for Attr<'a>
impl<'a> RefUnwindSafe for Attr<'a>
impl<'a> Send for Attr<'a>
impl<'a> Sync for Attr<'a>
impl<'a> Unpin for Attr<'a>
impl<'a> UnwindSafe for Attr<'a>
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