pub enum PropValue {
Null,
Bool(bool),
Int(i64),
Float(f64),
String(String),
Color(Color),
Enum(String),
Set(Vec<String>),
Bounds(Bounds),
Component(Option<ComponentId>),
Event(Option<String>),
}Expand description
Valor de uma propriedade.
Variants§
Null
Bool(bool)
Int(i64)
Float(f64)
String(String)
Color(Color)
Enum(String)
Set(Vec<String>)
Bounds(Bounds)
Component(Option<ComponentId>)
Event(Option<String>)
Implementations§
Source§impl PropValue
impl PropValue
pub fn kind_name(&self) -> &'static str
pub fn to_bool(&self) -> Result<bool>
pub fn to_i64(&self) -> Result<i64>
pub fn to_f64(&self) -> Result<f64>
pub fn to_f32(&self) -> Result<f32>
pub fn to_str(&self) -> Result<&str>
Sourcepub fn to_bounds(&self) -> Result<Bounds>
pub fn to_bounds(&self) -> Result<Bounds>
Aceita Bounds ou um número (o mesmo valor nos quatro lados).
Aceita também o texto, como no JSON: "8" (todos), "16, 12" (horizontal, vertical)
ou "12, 4, 12, 0" (esquerda, cima, direita, baixo); vírgula ou espaço separam. É como
o acesso tipado das linguagens manda margins e padding.
Sourcepub fn to_anchors(&self) -> Result<Anchors>
pub fn to_anchors(&self) -> Result<Anchors>
Aceita uma lista de nomes ou um texto separado por vírgulas ("left,right").
pub fn to_component(&self) -> Result<Option<ComponentId>>
Trait Implementations§
Source§impl From<ComponentId> for PropValue
impl From<ComponentId> for PropValue
Source§fn from(v: ComponentId) -> Self
fn from(v: ComponentId) -> Self
Converts to this type from the input type.
Source§impl From<Option<ComponentId>> for PropValue
impl From<Option<ComponentId>> for PropValue
Source§fn from(v: Option<ComponentId>) -> Self
fn from(v: Option<ComponentId>) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for PropValue
Auto Trait Implementations§
impl Forget for PropValue
impl Freeze for PropValue
impl Move for PropValue
impl RefUnwindSafe for PropValue
impl Send for PropValue
impl Sync for PropValue
impl Unpin for PropValue
impl UnsafeUnpin for PropValue
impl UnwindSafe for PropValue
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