pub struct Enum {
pub name: String,
pub etype: Option<String>,
pub arguments: Vec<Argument>,
}
Expand description
Represents a parsed enum argument.
Fields§
§name: String
§etype: Option<String>
§arguments: Vec<Argument>
Implementations§
Source§impl Enum
impl Enum
Sourcepub fn new<S: Into<String>>(name: S) -> Self
pub fn new<S: Into<String>>(name: S) -> Self
Creates a new Enum instance.
§Example
use thinlinelib::analysis::Enum;
let enumeration = Enum::new("testEnum");
assert_eq!(enumeration.name, String::from("testEnum"));
assert!(enumeration.etype.is_none());
assert!(enumeration.arguments.is_empty());
Sourcepub fn set_arguments(&mut self, arguments: &[Argument])
pub fn set_arguments(&mut self, arguments: &[Argument])
Sets arguments for the Enum.
§Example
use thinlinelib::analysis::{Argument, Enum};
let mut enumeration = Enum::new("testEnum");
let args = vec![Argument::new("Zero", Some("0")), Argument::new("Two", Some("2"))];
enumeration.set_arguments(&args);
assert_eq!(enumeration.arguments.len(), 2);
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Enum
impl<'de> Deserialize<'de> for Enum
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 EntityConversion for Enum
impl EntityConversion for Enum
impl StructuralPartialEq for Enum
Auto Trait Implementations§
impl Freeze for Enum
impl RefUnwindSafe for Enum
impl Send for Enum
impl Sync for Enum
impl Unpin for Enum
impl UnwindSafe for Enum
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