pub enum PropertyType {
Simple(SimplePropertyType),
Color(ColorPropertyType),
}Expand description
A fixture property, either a simple single-channel attribute or a color.
- Simple(
SimplePropertyType) – Any non-color property such as dimmer, pan, gobo, etc. - Color(
ColorPropertyType) – A color channel (RGB, CMY, or HSV).
Variants§
Simple(SimplePropertyType)
Color(ColorPropertyType)
Implementations§
Source§impl PropertyType
impl PropertyType
Sourcepub fn from_str(property_type: &str) -> Result<PropertyType, FixtureError>
pub fn from_str(property_type: &str) -> Result<PropertyType, FixtureError>
Parses a raw string slice into a strongly typed PropertyType.
It sequentially attempts to match the input string against known ColorPropertyType
variants first, and then falls back to SimplePropertyType variants.
§Arguments
property_type- A string slice representing the name of the property to parse.
§Errors
Returns a InvalidPropertyType-Error if the string matches neither
a color nor a simple property.
Trait Implementations§
Source§impl Clone for PropertyType
impl Clone for PropertyType
Source§fn clone(&self) -> PropertyType
fn clone(&self) -> PropertyType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PropertyType
impl Debug for PropertyType
Source§impl<'de> Deserialize<'de> for PropertyType
impl<'de> Deserialize<'de> for PropertyType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PropertyType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PropertyType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PropertyType
impl Display for PropertyType
impl Eq for PropertyType
Source§impl Hash for PropertyType
impl Hash for PropertyType
Source§impl PartialEq for PropertyType
impl PartialEq for PropertyType
Source§fn eq(&self, other: &PropertyType) -> bool
fn eq(&self, other: &PropertyType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PropertyType
impl Serialize for PropertyType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PropertyType
Auto Trait Implementations§
impl Freeze for PropertyType
impl RefUnwindSafe for PropertyType
impl Send for PropertyType
impl Sync for PropertyType
impl Unpin for PropertyType
impl UnsafeUnpin for PropertyType
impl UnwindSafe for PropertyType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.