Trait icu::pattern::PlaceholderValueProvider

source ·
pub trait PlaceholderValueProvider<K> {
    type Error;
    type W<'a>: TryWriteable<Error = Self::Error>
       where Self: 'a;

    const LITERAL_PART: Part;

    // Required method
    fn value_for(&self, key: K) -> (Self::W<'_>, Part);
}
Expand description

Trait implemented on collections that can produce TryWriteables for interpolation.

This trait determines the Parts produced by the writeable. In this crate, implementations of this trait default to using PATTERN_LITERAL_PART and PATTERN_PLACEHOLDER_PART.

Required Associated Types§

source

type Error

source

type W<'a>: TryWriteable<Error = Self::Error> where Self: 'a

Required Associated Constants§

Required Methods§

source

fn value_for(&self, key: K) -> (Self::W<'_>, Part)

Returns the TryWriteable to substitute for the given placeholder and the Part representing it.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'b, K, T> PlaceholderValueProvider<K> for &'b T

source§

type Error = <T as PlaceholderValueProvider<K>>::Error

source§

type W<'a> = <T as PlaceholderValueProvider<K>>::W<'a> where 'b: 'a, T: 'a

source§

const LITERAL_PART: Part = T::LITERAL_PART

source§

fn value_for( &self, key: K, ) -> (<&'b T as PlaceholderValueProvider<K>>::W<'_>, Part)

source§

impl<'k, K, W> PlaceholderValueProvider<MultiNamedPlaceholderKey<'k>> for BTreeMap<K, W>
where K: Ord + Borrow<str>, W: Writeable,

source§

type Error = MissingNamedPlaceholderError<'k>

source§

type W<'a> = Result<&'a W, <BTreeMap<K, W> as PlaceholderValueProvider<MultiNamedPlaceholderKey<'k>>>::Error> where W: 'a, BTreeMap<K, W>: 'a

source§

const LITERAL_PART: Part = crate::PATTERN_LITERAL_PART

source§

fn value_for<'a>( &'a self, key: MultiNamedPlaceholderKey<'k>, ) -> (<BTreeMap<K, W> as PlaceholderValueProvider<MultiNamedPlaceholderKey<'k>>>::W<'a>, Part)

source§

impl<'k, K, W, S> PlaceholderValueProvider<MultiNamedPlaceholderKey<'k>> for LiteMap<K, W, S>
where K: Ord + Borrow<str>, W: Writeable, S: Store<K, W>,

source§

type Error = MissingNamedPlaceholderError<'k>

source§

type W<'a> = Result<&'a W, <LiteMap<K, W, S> as PlaceholderValueProvider<MultiNamedPlaceholderKey<'k>>>::Error> where W: 'a, LiteMap<K, W, S>: 'a

source§

const LITERAL_PART: Part = crate::PATTERN_LITERAL_PART

source§

fn value_for<'a>( &'a self, key: MultiNamedPlaceholderKey<'k>, ) -> (<LiteMap<K, W, S> as PlaceholderValueProvider<MultiNamedPlaceholderKey<'k>>>::W<'a>, Part)

source§

impl<W0, W1> PlaceholderValueProvider<DoublePlaceholderKey> for (W0, W1)
where W0: Writeable, W1: Writeable,

source§

impl<W> PlaceholderValueProvider<DoublePlaceholderKey> for [W; 2]
where W: Writeable,

source§

impl<W> PlaceholderValueProvider<SinglePlaceholderKey> for [W; 1]
where W: Writeable,

source§

impl<W> PlaceholderValueProvider<SinglePlaceholderKey> for (W,)
where W: Writeable,

Implementors§