pub struct SiteNative {
pub sites: Vec<Site>,
}Expand description
Contains the information from the Prelude native site XML.
Fields§
§sites: Vec<Site>Implementations§
Source§impl SiteNative
impl SiteNative
Sourcepub fn to_json(&self) -> Result<String>
pub fn to_json(&self) -> Result<String>
Convert to a JSON string
§Example
use std::path::Path;
use prelude_xml_parser::parse_site_native_file;
let file_path = Path::new("tests/assets/site_native_small.xml");
let native = parse_site_native_file(&file_path).unwrap();
let json = native.to_json().unwrap();
println!("{json}");
// Verify the JSON contains expected site data
assert!(json.contains("Some Site"));
assert!(json.contains("Paul Sanders"));
assert!(json.contains("Some Company"));Trait Implementations§
Source§impl Clone for SiteNative
impl Clone for SiteNative
Source§fn clone(&self) -> SiteNative
fn clone(&self) -> SiteNative
Returns a duplicate of the value. Read more
1.0.0 · 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 SiteNative
impl Debug for SiteNative
Source§impl<'de> Deserialize<'de> for SiteNative
impl<'de> Deserialize<'de> for SiteNative
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SiteNative
impl PartialEq for SiteNative
Source§impl Serialize for SiteNative
impl Serialize for SiteNative
impl StructuralPartialEq for SiteNative
Auto Trait Implementations§
impl Freeze for SiteNative
impl RefUnwindSafe for SiteNative
impl Send for SiteNative
impl Sync for SiteNative
impl Unpin for SiteNative
impl UnwindSafe for SiteNative
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