pub struct EtherCatInfo {
pub version: Option<String>,
pub info_reference: Option<String>,
pub vendor: Vendor,
pub description: Description,
}Expand description
EtherCAT Slave Information (ESI).
Fields§
§version: Option<String>§info_reference: Option<String>§vendor: Vendor§description: DescriptionImplementations§
Source§impl EtherCatInfo
impl EtherCatInfo
Sourcepub fn from_xml_str(xml: &str) -> Result<Self>
pub fn from_xml_str(xml: &str) -> Result<Self>
Examples found in repository?
examples/basic.rs (line 17)
8fn main() -> io::Result<()> {
9 match env::args().nth(1) {
10 None => {
11 eprintln!("Missing filename");
12 }
13 Some(file_name) => {
14 let mut xml_file = File::open(file_name)?;
15 let mut xml_string = String::new();
16 xml_file.read_to_string(&mut xml_string)?;
17 let info = EtherCatInfo::from_xml_str(&xml_string)?;
18 println!("{:#?}", info);
19 }
20 }
21 Ok(())
22}Trait Implementations§
Source§impl Clone for EtherCatInfo
impl Clone for EtherCatInfo
Source§fn clone(&self) -> EtherCatInfo
fn clone(&self) -> EtherCatInfo
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 moreAuto Trait Implementations§
impl Freeze for EtherCatInfo
impl RefUnwindSafe for EtherCatInfo
impl Send for EtherCatInfo
impl Sync for EtherCatInfo
impl Unpin for EtherCatInfo
impl UnwindSafe for EtherCatInfo
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