Struct Fields
struct Fields(_)
A list of Key-Value pairs representing functional information
about content transformations.
Here are examples of fields used in Unicode:
s0,d0- Transform source/destinationt0- Machine Translationh0- Hybrid Locale Identifiers
You can find the full list in Unicode BCP 47 T Extension section of LDML.
Examples
use ;
let value = "hybrid"..expect;
let fields = .into_iter.;
assert_eq!;
Implementations
impl Fields
impl Fields
const fn new() -> SelfReturns a new empty list of key-value pairs. Same as
default(), but isconst.Examples
use Fields; assert_eq!;fn is_empty(self: &Self) -> boolReturns
trueif there are no fields.Examples
use locale; use Locale; let loc1 = try_from_str.unwrap; let loc2 = locale!; assert!; assert!;fn clear(self: &mut Self) -> SelfEmpties the
Fieldslist.Returns the old list.
Examples
use ; let value = "hybrid"..expect; let mut fields = .into_iter.; assert_eq!; fields.clear; assert_eq!;fn contains_key<Q>(self: &Self, key: &Q) -> bool where Key: Borrow<Q>, Q: OrdReturns
trueif the list contains aValuefor the specifiedKey.Examples
use ; let key: Key = "h0".parse.expect; let value: Value = "hybrid".parse.expect; let mut fields = .into_iter.; let key: Key = "h0".parse.expect; assert!;fn get<Q>(self: &Self, key: &Q) -> Option<&Value> where Key: Borrow<Q>, Q: OrdReturns a reference to the
Valuecorresponding to theKey.Examples
use ; let value = "hybrid"..unwrap; let fields = .into_iter .; assert_eq!;fn set(self: &mut Self, key: Key, value: Value) -> Option<Value>Sets the specified keyword, returning the old value if it already existed.
Examples
use ; use Locale; let lower = "lower"..expect; let casefold = "casefold"..expect; let mut loc: Locale = "en-t-hi-d0-casefold" .parse .expect; let old_value = loc.extensions.transform.fields.set; assert_eq!; assert_eq!;fn retain_by_key<F>(self: &mut Self, predicate: F) where F: FnMut(&Key) -> boolRetains a subset of fields as specified by the predicate function.
Examples
use key; use Locale; let mut loc: Locale = "und-t-h0-hybrid-d0-hex-m0-xml".parse.unwrap; loc.extensions .transform .fields .retain_by_key; assert_eq!; loc.extensions .transform .fields .retain_by_key; assert_eq!;
impl Clone for Fields
fn clone(self: &Self) -> Fields
impl Debug for Fields
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for Fields
fn default() -> Fields
impl Display for Fields
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Fields
impl Freeze for Fields
impl From for Fields
fn from(map: LiteMap<Key, Value>) -> Self
impl FromIterator for Fields
fn from_iter<I: IntoIterator<Item = (Key, Value)>>(iter: I) -> Self
impl Hash for Fields
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl Ord for Fields
fn cmp(self: &Self, other: &Fields) -> Ordering
impl PartialEq for Fields
fn eq(self: &Self, other: &Fields) -> bool
impl PartialOrd for Fields
fn partial_cmp(self: &Self, other: &Fields) -> Option<Ordering>
impl RefUnwindSafe for Fields
impl Send for Fields
impl StructuralPartialEq for Fields
impl Sync for Fields
impl Unpin for Fields
impl UnsafeUnpin for Fields
impl UnwindSafe for Fields
impl Writeable for Fields
fn write_to<W: core::fmt::Write + ?Sized>(self: &Self, sink: &mut W) -> Resultfn writeable_length_hint(self: &Self) -> LengthHint
impl<T> Any for Fields
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Fields
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Fields
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Fields
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for Fields
impl<T> From for Fields
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Fields
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Fields
fn to_string(self: &Self) -> String
impl<T, U> Into for Fields
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Fields
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Fields
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>