Trait SwiftField

Source
pub trait SwiftField:
    Serialize
    + for<'de> Deserialize<'de>
    + Clone
    + Debug {
    // Required methods
    fn parse(value: &str) -> Result<Self>
       where Self: Sized;
    fn to_swift_string(&self) -> String;
    fn validate(&self) -> ValidationResult;
    fn format_spec() -> &'static str;
}
Expand description

Core trait for all Swift field types

Required Methods§

Source

fn parse(value: &str) -> Result<Self>
where Self: Sized,

Parse field value from string representation

Source

fn to_swift_string(&self) -> String

Convert field back to SWIFT string format

Source

fn validate(&self) -> ValidationResult

Validate field according to SWIFT format rules

Source

fn format_spec() -> &'static str

Get field format specification

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§