ink_metadata::layout

Struct FieldLayout

Source
pub struct FieldLayout<F: Form = MetaForm> { /* private fields */ }
Expand description

The layout for a particular field of a struct layout.

Implementations§

Source§

impl<F> FieldLayout<F>
where F: Form,

Source

pub fn new<N, L>(name: N, layout: L) -> Self
where N: Into<F::String>, L: Into<Layout<F>>,

Creates a new custom field layout.

Source

pub fn name(&self) -> &F::String

Returns the name of the field.

Source

pub fn layout(&self) -> &Layout<F>

Returns the kind of the field.

This is either a direct layout bound or another recursive layout sub-struct.

Trait Implementations§

Source§

impl<F: Debug + Form> Debug for FieldLayout<F>
where F::String: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, F: Form> Deserialize<'de> for FieldLayout<F>

Source§

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 IntoPortable for FieldLayout

Source§

type Output = FieldLayout<PortableForm>

The portable version of Self.
Source§

fn into_portable(self, registry: &mut Registry) -> Self::Output

Convert self to the portable form by using the registry for caching.
Source§

impl<F: Form + JsonSchema> JsonSchema for FieldLayout<F>

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl<F: Ord + Form> Ord for FieldLayout<F>
where F::String: Ord,

Source§

fn cmp(&self, other: &FieldLayout<F>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<F: PartialEq + Form> PartialEq for FieldLayout<F>
where F::String: PartialEq,

Source§

fn eq(&self, other: &FieldLayout<F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: PartialOrd + Form> PartialOrd for FieldLayout<F>
where F::String: PartialOrd,

Source§

fn partial_cmp(&self, other: &FieldLayout<F>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<F: Form> Serialize for FieldLayout<F>
where F::Type: Serialize, F::String: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<F: Eq + Form> Eq for FieldLayout<F>
where F::String: Eq,

Source§

impl<F: Form> StructuralPartialEq for FieldLayout<F>

Auto Trait Implementations§

§

impl<F> Freeze for FieldLayout<F>
where <F as Form>::String: Freeze, <F as Form>::Type: Freeze,

§

impl<F> RefUnwindSafe for FieldLayout<F>
where <F as Form>::String: RefUnwindSafe, <F as Form>::Type: RefUnwindSafe,

§

impl<F> Send for FieldLayout<F>
where <F as Form>::String: Send, <F as Form>::Type: Send,

§

impl<F> Sync for FieldLayout<F>
where <F as Form>::String: Sync, <F as Form>::Type: Sync,

§

impl<F> Unpin for FieldLayout<F>
where <F as Form>::String: Unpin, <F as Form>::Type: Unpin,

§

impl<F> UnwindSafe for FieldLayout<F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> JsonSchemaMaybe for T
where T: JsonSchema,