| 1 | //! The nodes. |
| 2 | |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::hash_maprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash_map/::DefaultHasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/random/DefaultHasher#; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#; |
| 5 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/; |
| 6 | |
| 7 | mod blobrust-analyzer cargo svg 0.18.0 node/blob/; |
| 8 | mod commentrust-analyzer cargo svg 0.18.0 node/comment/; |
| 9 | mod textrust-analyzer cargo svg 0.18.0 node/text/; |
| 10 | mod valuerust-analyzer cargo svg 0.18.0 node/value/; |
| 11 | |
| 12 | pub use selfrust-analyzer cargo svg 0.18.0 node/::blobrust-analyzer cargo svg 0.18.0 node/blob/::Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob#; |
| 13 | pub use selfrust-analyzer cargo svg 0.18.0 node/::commentrust-analyzer cargo svg 0.18.0 node/comment/::Commentrust-analyzer cargo svg 0.18.0 node/comment/Comment#; |
| 14 | pub use selfrust-analyzer cargo svg 0.18.0 node/::textrust-analyzer cargo svg 0.18.0 node/text/::Textrust-analyzer cargo svg 0.18.0 node/text/Text#; |
| 15 | pub use selfrust-analyzer cargo svg 0.18.0 node/::valuerust-analyzer cargo svg 0.18.0 node/value/::Valuerust-analyzer cargo svg 0.18.0 node/value/Value#; |
| 16 | |
| 17 | /// Attributes. |
| 18 | pub type Attributesrust-analyzer cargo svg 0.18.0 node/Attributes# = HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, Valuerust-analyzer cargo svg 0.18.0 node/value/Value#>; |
| 19 | |
| 20 | /// Child nodes. |
| 21 | pub type Childrenrust-analyzer cargo svg 0.18.0 node/Children# = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#>>; |
| 22 | |
| 23 | /// A node. |
| 24 | pub trait Noderust-analyzer cargo svg 0.18.0 node/Node#: |
| 25 | 'static + fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# + NodeClonerust-analyzer cargo svg 0.18.0 node/NodeClone# + NodeDefaultHashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# |
| 26 | { |
| 27 | /// Append a child node. |
| 28 | #[inline] |
| 29 | fn appendrust-analyzer cargo svg 0.18.0 node/Node#append().<T>(&mut self, _: T) |
| 30 | where |
| 31 | Self: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#, |
| 32 | T: Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#>>, |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | /// Assign an attribute. |
| 37 | #[inline] |
| 38 | fn assignrust-analyzer cargo svg 0.18.0 node/Node#assign().<T, U>(&mut self, _: T, _: U) |
| 39 | where |
| 40 | Self: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#, |
| 41 | T: Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 42 | U: Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Valuerust-analyzer cargo svg 0.18.0 node/value/Value#>, |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | /// Return the name. |
| 47 | fn get_namerust-analyzer cargo svg 0.18.0 node/Node#get_name().(&self) -> &str; |
| 48 | |
| 49 | /// Return the attributes. |
| 50 | #[inline] |
| 51 | fn get_attributesrust-analyzer cargo svg 0.18.0 node/Node#get_attributes().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Attributesrust-analyzer cargo svg 0.18.0 node/Attributes#> { |
| 52 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 53 | } |
| 54 | |
| 55 | /// Return the attributes as mutable. |
| 56 | fn get_attributes_mutrust-analyzer cargo svg 0.18.0 node/Node#get_attributes_mut().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&mut Attributesrust-analyzer cargo svg 0.18.0 node/Attributes#> { |
| 57 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 58 | } |
| 59 | |
| 60 | /// Return the children. |
| 61 | fn get_childrenrust-analyzer cargo svg 0.18.0 node/Node#get_children().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Childrenrust-analyzer cargo svg 0.18.0 node/Children#> { |
| 62 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 63 | } |
| 64 | |
| 65 | /// Return the children as mutable. |
| 66 | fn get_children_mutrust-analyzer cargo svg 0.18.0 node/Node#get_children_mut().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&mut Childrenrust-analyzer cargo svg 0.18.0 node/Children#> { |
| 67 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 68 | } |
| 69 | |
| 70 | #[doc(hidden)] |
| 71 | fn is_barerust-analyzer cargo svg 0.18.0 node/Node#is_bare().(&self) -> bool { |
| 72 | false |
| 73 | } |
| 74 | |
| 75 | #[doc(hidden)] |
| 76 | fn is_bareablerust-analyzer cargo svg 0.18.0 node/Node#is_bareable().(&self) -> bool { |
| 77 | false |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | #[doc(hidden)] |
| 82 | pub trait NodeClonerust-analyzer cargo svg 0.18.0 node/NodeClone# { |
| 83 | fn clonerust-analyzer cargo svg 0.18.0 node/NodeClone#clone().(&self) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#>; |
| 84 | } |
| 85 | |
| 86 | #[doc(hidden)] |
| 87 | pub trait NodeDefaultHashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash# { |
| 88 | fn default_hashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash#default_hash().(&self, state: &mut DefaultHasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/random/DefaultHasher#); |
| 89 | } |
| 90 | |
| 91 | impl<T> NodeClonerust-analyzer cargo svg 0.18.0 node/NodeClone# for T |
| 92 | where |
| 93 | T: Noderust-analyzer cargo svg 0.18.0 node/Node# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 94 | { |
| 95 | #[inline] |
| 96 | fn clonerust-analyzer cargo svg 0.18.0 node/impl#[T][NodeClone]clone().(&self) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#> { |
| 97 | Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#::clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(self)) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | impl Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# for Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#> { |
| 102 | #[inline] |
| 103 | fn clonerust-analyzer cargo svg 0.18.0 node/impl#[`Box<dyn Node + 'static>`][Clone]clone().(&self) -> Selfrust-analyzer cargo svg 0.18.0 node/impl#[`Box<dyn Node + 'static>`][Clone] { |
| 104 | NodeClonerust-analyzer cargo svg 0.18.0 node/NodeClone#::clonerust-analyzer cargo svg 0.18.0 node/NodeClone#clone().(&*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | impl<T> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<T> for Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#> |
| 109 | where |
| 110 | T: Noderust-analyzer cargo svg 0.18.0 node/Node#, |
| 111 | { |
| 112 | #[inline] |
| 113 | fn fromrust-analyzer cargo svg 0.18.0 node/impl#[`Box<dyn Node + 'static>`][`From<T>`]from().(node: T) -> Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#> { |
| 114 | Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(node) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | impl NodeDefaultHashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash# for Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Noderust-analyzer cargo svg 0.18.0 node/Node#> { |
| 119 | #[inline] |
| 120 | fn default_hashrust-analyzer cargo svg 0.18.0 node/impl#[`Box<dyn Node + 'static>`][NodeDefaultHash]default_hash().(&self, state: &mut DefaultHasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/random/DefaultHasher#) { |
| 121 | NodeDefaultHashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash#::default_hashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash#default_hash().(&*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self, state) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | pub mod elementrust-analyzer cargo svg 0.18.0 node/element/; |