pub struct OpenDrive {
pub header: Header,
pub road: Vec<Road>,
pub controller: Vec<Controller>,
pub junction: Vec<Junction>,
pub junction_group: Vec<JunctionGroup>,
pub station: Vec<Station>,
pub additional_data: AdditionalData,
}Fields§
§header: Header§road: Vec<Road>§controller: Vec<Controller>§junction: Vec<Junction>§junction_group: Vec<JunctionGroup>§station: Vec<Station>§additional_data: AdditionalDataImplementations§
Source§impl OpenDrive
impl OpenDrive
Sourcepub fn from_xml_str(s: &str) -> Result<Self>
pub fn from_xml_str(s: &str) -> Result<Self>
Examples found in repository?
examples/inout.rs (line 12)
11fn main() {
12 let opendrive = OpenDrive::from_xml_str(XML).unwrap();
13
14 dbg!(&opendrive.header);
15 dbg!(&opendrive.additional_data);
16
17 for _ in &opendrive.road {}
18 for _ in &opendrive.junction {}
19 for _ in &opendrive.junction_group {}
20 for _ in &opendrive.controller {}
21
22 println!("XML: {}", opendrive.to_xml_string().unwrap());
23}pub fn from_xml_read<T: Read>(r: T) -> Result<Self>
pub fn from_reader<T: Read>(reader: EventReader<T>) -> Result<Self>
pub fn to_writer(&self) -> Result<EventWriter<Vec<u8>>>
Sourcepub fn to_xml_string(&self) -> Result<String>
pub fn to_xml_string(&self) -> Result<String>
Examples found in repository?
examples/inout.rs (line 22)
11fn main() {
12 let opendrive = OpenDrive::from_xml_str(XML).unwrap();
13
14 dbg!(&opendrive.header);
15 dbg!(&opendrive.additional_data);
16
17 for _ in &opendrive.road {}
18 for _ in &opendrive.junction {}
19 for _ in &opendrive.junction_group {}
20 for _ in &opendrive.controller {}
21
22 println!("XML: {}", opendrive.to_xml_string().unwrap());
23}pub fn to_xml_write(&self, w: impl Write) -> Result<()>
pub fn append_to_writer<'b, T: Write + 'b>( &self, writer: &'b mut EventWriter<T>, ) -> Result<()>
pub fn visit_attributes( &self, visitor: impl for<'b> FnOnce(Cow<'b, [Attribute<'b>]>) -> Result<()>, ) -> Result<()>
pub fn visit_children( &self, visitor: impl FnMut(XmlEvent<'_>) -> Result<()>, ) -> Result<()>
Trait Implementations§
Source§impl<'a, I> TryFrom<ReadContext<'a, I>> for OpenDrive
impl<'a, I> TryFrom<ReadContext<'a, I>> for OpenDrive
impl StructuralPartialEq for OpenDrive
Auto Trait Implementations§
impl Freeze for OpenDrive
impl RefUnwindSafe for OpenDrive
impl Send for OpenDrive
impl Sync for OpenDrive
impl Unpin for OpenDrive
impl UnsafeUnpin for OpenDrive
impl UnwindSafe for OpenDrive
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