| 1 | 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#; |
| 2 | 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/; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::hashrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/::Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#; |
| 4 | |
| 5 | use craterust-analyzer cargo svg 0.18.0 crate/::noderust-analyzer cargo svg 0.18.0 node/::Noderust-analyzer cargo svg 0.18.0 node/Node#; |
| 6 | |
| 7 | /// A blob node. |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 9 | pub struct Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob# { |
| 10 | contentrust-analyzer cargo svg 0.18.0 node/blob/Blob#content.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 11 | } |
| 12 | |
| 13 | impl Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob# { |
| 14 | /// Create a node. |
| 15 | #[inline] |
| 16 | pub fn newrust-analyzer cargo svg 0.18.0 node/blob/impl#[Blob]new().<T>(content: T) -> Selfrust-analyzer cargo svg 0.18.0 node/blob/impl#[Blob] |
| 17 | where |
| 18 | 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#>, |
| 19 | { |
| 20 | Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob# { |
| 21 | contentrust-analyzer cargo svg 0.18.0 node/blob/Blob#content.: content.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#into().(), |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | impl 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# for Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob# { |
| 27 | #[inline] |
| 28 | fn fmtrust-analyzer cargo svg 0.18.0 node/blob/impl#[Blob][Display]fmt().(&self, formatter: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 29 | self.contentrust-analyzer cargo svg 0.18.0 node/blob/Blob#content..fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Display]fmt().(formatter) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | impl Noderust-analyzer cargo svg 0.18.0 node/Node# for Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob# { |
| 34 | #[inline] |
| 35 | fn get_namerust-analyzer cargo svg 0.18.0 node/blob/impl#[Blob][Node]get_name().(&self) -> &str { |
| 36 | "blob" |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | impl superrust-analyzer cargo svg 0.18.0 node/::NodeDefaultHashrust-analyzer cargo svg 0.18.0 node/NodeDefaultHash# for Blobrust-analyzer cargo svg 0.18.0 node/blob/Blob# { |
| 41 | #[inline] |
| 42 | fn default_hashrust-analyzer cargo svg 0.18.0 node/blob/impl#[Blob][NodeDefaultHash]default_hash().(&self, state: &mut DefaultHasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/random/DefaultHasher#) { |
| 43 | self.contentrust-analyzer cargo svg 0.18.0 node/blob/Blob#content..hashrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Hash]hash().(state); |
| 44 | } |
| 45 | } |