Skip to main content

StringValueData

Trait StringValueData 

Source
pub trait StringValueData: Clone {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn parse_from_str(s: &str) -> Result<Self, Self::Error>
       where Self: Sized;
    fn to_raw_value(&self) -> String;
}
Expand description

Trait for data types that can be used with StringValue, defines how to parse and serialize the value.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type returned when parsing the value from a string fails.

Required Methods§

Source

fn parse_from_str(s: &str) -> Result<Self, Self::Error>
where Self: Sized,

Parse the value from a string.

Source

fn to_raw_value(&self) -> String

Convert the value to its raw string representation.

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.

Implementations on Foreign Types§

Source§

impl StringValueData for bool

Source§

impl StringValueData for u64

Source§

type Error = ParseIntError

Source§

fn parse_from_str(s: &str) -> Result<Self, Self::Error>
where Self: Sized,

Source§

fn to_raw_value(&self) -> String

Source§

impl StringValueData for String

Source§

type Error = Infallible

Source§

fn parse_from_str(s: &str) -> Result<Self, Self::Error>
where Self: Sized,

Source§

fn to_raw_value(&self) -> String

Source§

impl StringValueData for NonZeroU64

Source§

type Error = ParseIntError

Source§

fn parse_from_str(s: &str) -> Result<Self, Self::Error>
where Self: Sized,

Source§

fn to_raw_value(&self) -> String

Implementors§

Source§

impl StringValueData for RankingType

Source§

impl StringValueData for AffiliationType

Source§

impl StringValueData for ElectionCategory

Source§

impl StringValueData for ElectionSubcategory

Source§

impl StringValueData for Gender

Source§

impl StringValueData for PublicationLanguage

Source§

impl StringValueData for VotingChannelType

Source§

impl StringValueData for VotingMethod

Source§

impl StringValueData for XsDateOrDateTime

Source§

impl StringValueData for ListDataBelongsToCombination

Source§

impl StringValueData for YesNoType

Source§

impl StringValueData for PhysicalLocationPollingStationId

Source§

impl StringValueData for AffiliationId

Source§

impl StringValueData for AuthorityId

Source§

impl StringValueData for CandidateId

Source§

impl StringValueData for ContestId

Source§

impl StringValueData for ContestIdGeen

Source§

impl StringValueData for ElectionDomainId

Source§

impl StringValueData for ElectionId

Source§

impl StringValueData for NameShortCode

Source§

impl StringValueData for ReportingUnitIdentifierId

Source§

impl StringValueData for XsDate

Source§

impl StringValueData for XsDateTime