pub struct FileName {
pub id: Option<String>,
pub namespace: String,
pub name: String,
pub version: Option<Version>,
}
Expand description
Uniquely defines a DSDL file
Fields§
§id: Option<String>
§namespace: String
§name: String
§version: Option<Version>
Implementations§
Source§impl FileName
impl FileName
Sourcepub fn split_namespace(&self) -> Vec<String>
pub fn split_namespace(&self) -> Vec<String>
Split a namespace into parts
§Examples
use dsdl_parser::FileName;
let name = FileName {
id: Some(String::from("341")),
namespace: String::from("uavcan.protocol"),
name: String::from("NodeStatus"),
version: None,
};
assert_eq!(name.split_namespace(), vec!["uavcan", "protocol"]);
Sourcepub fn rsplit_namespace(&self) -> Vec<String>
pub fn rsplit_namespace(&self) -> Vec<String>
Split a namespace into parts
§Examples
use dsdl_parser::FileName;
let name = FileName {
id: Some(String::from("341")),
namespace: String::from("uavcan.protocol"),
name: String::from("NodeStatus"),
version: None,
};
assert_eq!(name.rsplit_namespace(), vec!["protocol", "uavcan"]);
Trait Implementations§
impl Eq for FileName
impl StructuralPartialEq for FileName
Auto Trait Implementations§
impl Freeze for FileName
impl RefUnwindSafe for FileName
impl Send for FileName
impl Sync for FileName
impl Unpin for FileName
impl UnwindSafe for FileName
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