pub struct Property {
pub path: String,
pub kind: PropertyKind,
pub label: Option<String>,
pub description: Option<String>,
pub constant: Option<String>,
}Expand description
Defines a property in a template with full metadata
Fields§
§path: StringThe path to the field in the IDL (e.g., “liquidity”, “fees.swap_fee_numerator”)
kind: PropertyKindThe type of property - determines rendering behavior
label: Option<String>Human-readable label for the UI (optional, defaults to path)
description: Option<String>Description of the field (optional, can come from IDL)
constant: Option<String>For constant_ref type: the name of the constant definition to use
Implementations§
Source§impl Property
impl Property
Sourcepub fn constant_ref(
path: impl Into<String>,
constant: impl Into<String>,
) -> Self
pub fn constant_ref( path: impl Into<String>, constant: impl Into<String>, ) -> Self
Create a new constant_ref property
Sourcepub fn is_constant_ref(&self) -> bool
pub fn is_constant_ref(&self) -> bool
Check if this is a constant reference
Sourcepub fn constant_name(&self) -> Option<&str>
pub fn constant_name(&self) -> Option<&str>
Get the constant name if this is a constant reference
Sourcepub fn display_label(&self) -> &str
pub fn display_label(&self) -> &str
Get the display label (falls back to path if no label set)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Property
impl<'de> Deserialize<'de> for Property
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 From<PropertyType> for Property
impl From<PropertyType> for Property
Source§fn from(pt: PropertyType) -> Self
fn from(pt: PropertyType) -> Self
Converts to this type from the input type.
Source§impl From<YamlProperty> for Property
impl From<YamlProperty> for Property
Source§fn from(yaml: YamlProperty) -> Self
fn from(yaml: YamlProperty) -> Self
Converts to this type from the input type.
Source§impl From<YamlPropertyType> for Property
impl From<YamlPropertyType> for Property
Source§fn from(yaml: YamlPropertyType) -> Self
fn from(yaml: YamlPropertyType) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Property
Auto Trait Implementations§
impl Freeze for Property
impl RefUnwindSafe for Property
impl Send for Property
impl Sync for Property
impl Unpin for Property
impl UnsafeUnpin for Property
impl UnwindSafe for Property
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>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more