Atomic

Enum Atomic 

Source
pub enum Atomic {
Show 21 variants Untyped(Rc<str>), String(StringType, Rc<str>), Float(OrderedFloat<f32>), Double(OrderedFloat<f64>), Decimal(Rc<Decimal>), Integer(IntegerType, Rc<IBig>), Duration(Rc<Duration>), YearMonthDuration(YearMonthDuration), DayTimeDuration(Rc<TimeDelta>), DateTime(Rc<NaiveDateTimeWithOffset>), DateTimeStamp(Rc<DateTime<FixedOffset>>), Time(Rc<NaiveTimeWithOffset>), Date(Rc<NaiveDateWithOffset>), GYearMonth(Rc<GYearMonth>), GYear(Rc<GYear>), GMonthDay(Rc<GMonthDay>), GDay(Rc<GDay>), GMonth(Rc<GMonth>), Boolean(bool), Binary(BinaryType, Rc<[u8]>), QName(Rc<OwnedName>),
}
Expand description

An atomic value.

These are designated with a xs: namespace prefix and are described by the XPath data model.

Variants§

§

Untyped(Rc<str>)

xs:untypedAtomic

§

String(StringType, Rc<str>)

a string type such as xs:string, xs:token, etc

§

Float(OrderedFloat<f32>)

xs:float

This is an ordered_float::OrderedFloat

§

Double(OrderedFloat<f64>)

xs:double

This is an ordered_float::OrderedFloat

§

Decimal(Rc<Decimal>)

xs:decimal

This is a rust_decimal::Decimal

§

Integer(IntegerType, Rc<IBig>)

xs integer types (xs:integer, xs:long, xs:int, etc)

This is an ibig::IBig

§

Duration(Rc<Duration>)

xs:duration

§

YearMonthDuration(YearMonthDuration)

xs:yearMonthDuration

§

DayTimeDuration(Rc<TimeDelta>)

xs:dayTimeDuration

This is a chrono::Duration

§

DateTime(Rc<NaiveDateTimeWithOffset>)

xs:dateTime

§

DateTimeStamp(Rc<DateTime<FixedOffset>>)

xs:dateTimeStamp

This is a chrono::DateTime with a fixed offset

§

Time(Rc<NaiveTimeWithOffset>)

xs:time

§

Date(Rc<NaiveDateWithOffset>)

xs:date

§

GYearMonth(Rc<GYearMonth>)

xs:gYearMonth

§

GYear(Rc<GYear>)

xs:gYear

§

GMonthDay(Rc<GMonthDay>)

xs:gMonthDay

§

GDay(Rc<GDay>)

xs:gMonth

§

GMonth(Rc<GMonth>)

xs:gDay

§

Boolean(bool)

xs:boolean

§

Binary(BinaryType, Rc<[u8]>)

xs binary types (xs:hexBinary, xs:base64Binary)

§

QName(Rc<OwnedName>)

xs:QName

Implementations§

Source§

impl Atomic

Source

pub fn to_string(&self) -> Result<String, Error>

Get the string if this atomic value is a xs:string

Source

pub fn is_nan(&self) -> bool

Check whether this value is the NaN value.

Only xs:float and xs:double can be NaN.

Source

pub fn is_infinite(&self) -> bool

Check whether this value is infinite.

Only xs:float and xs:double can be infinite.

Source

pub fn is_zero(&self) -> bool

Check whether this value is zero.

Only numeric types can be zero.

Source

pub fn is_numeric(&self) -> bool

Check whether this is a numeric value.

That is, xs:float, xs:double, xs:decimal, xs:integer and any types derived from xs:integer such as xs:int, xs:long, etc.

Source

pub fn simple_equal(&self, other: &Atomic) -> bool

Compare atoms using XPath rules.

This means for instance that an integer can compare the same as a decimal. This is different from the Eq implemented for the atom itself, which compares the actual data, and different types are always distinct in that case.

Simple equal uses a comparison with the codepoint collation, and UTC as the timezone.

Source

pub fn equal( &self, other: &Atomic, collation: &Collation, default_offset: FixedOffset, ) -> bool

Compare atoms using XPath rules, with explicit collation and offset.

Source§

impl Atomic

Source

pub fn xpath_representation(&self) -> String

XPath representation of the atomic value.

Trait Implementations§

Source§

impl Clone for Atomic

Source§

fn clone(&self) -> Atomic

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Atomic

Source§

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

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

impl Display for Atomic

Source§

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

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

impl From<&RiReferenceStr<IriSpec>> for Atomic

Source§

fn from(u: &RiReferenceStr<IriSpec>) -> Atomic

Converts to this type from the input type.
Source§

impl From<&String> for Atomic

Source§

fn from(s: &String) -> Atomic

Converts to this type from the input type.
Source§

impl From<&str> for Atomic

Source§

fn from(s: &str) -> Atomic

Converts to this type from the input type.
Source§

impl From<DateTime<FixedOffset>> for Atomic

Source§

fn from(date_time: DateTime<FixedOffset>) -> Atomic

Converts to this type from the input type.
Source§

impl From<Decimal> for Atomic

Source§

fn from(d: Decimal) -> Atomic

Converts to this type from the input type.
Source§

impl From<Duration> for Atomic

Source§

fn from(duration: Duration) -> Atomic

Converts to this type from the input type.
Source§

impl From<GDay> for Atomic

Source§

fn from(g_day: GDay) -> Atomic

Converts to this type from the input type.
Source§

impl From<GMonth> for Atomic

Source§

fn from(g_month: GMonth) -> Atomic

Converts to this type from the input type.
Source§

impl From<GMonthDay> for Atomic

Source§

fn from(g_month_day: GMonthDay) -> Atomic

Converts to this type from the input type.
Source§

impl From<GYear> for Atomic

Source§

fn from(g_year: GYear) -> Atomic

Converts to this type from the input type.
Source§

impl From<GYearMonth> for Atomic

Source§

fn from(g_year_month: GYearMonth) -> Atomic

Converts to this type from the input type.
Source§

impl From<IBig> for Atomic

Source§

fn from(i: IBig) -> Atomic

Converts to this type from the input type.
Source§

impl From<NaiveDateTimeWithOffset> for Atomic

Source§

fn from(date_time: NaiveDateTimeWithOffset) -> Atomic

Converts to this type from the input type.
Source§

impl From<NaiveDateWithOffset> for Atomic

Source§

fn from(date: NaiveDateWithOffset) -> Atomic

Converts to this type from the input type.
Source§

impl From<NaiveTimeWithOffset> for Atomic

Source§

fn from(time: NaiveTimeWithOffset) -> Atomic

Converts to this type from the input type.
Source§

impl From<OwnedName> for Atomic

Source§

fn from(n: OwnedName) -> Atomic

Converts to this type from the input type.
Source§

impl From<OrderedFloat<f32>> for Atomic

Source§

fn from(f: OrderedFloat<f32>) -> Atomic

Converts to this type from the input type.
Source§

impl From<OrderedFloat<f64>> for Atomic

Source§

fn from(f: OrderedFloat<f64>) -> Atomic

Converts to this type from the input type.
Source§

impl From<Rc<IBig>> for Atomic

Source§

fn from(i: Rc<IBig>) -> Atomic

Converts to this type from the input type.
Source§

impl From<RiReferenceString<IriSpec>> for Atomic

Source§

fn from(u: RiReferenceString<IriSpec>) -> Atomic

Converts to this type from the input type.
Source§

impl From<RiString<IriSpec>> for Atomic

Source§

fn from(u: RiString<IriSpec>) -> Atomic

Converts to this type from the input type.
Source§

impl From<String> for Atomic

Source§

fn from(s: String) -> Atomic

Converts to this type from the input type.
Source§

impl From<TimeDelta> for Atomic

Source§

fn from(duration: TimeDelta) -> Atomic

Converts to this type from the input type.
Source§

impl From<YearMonthDuration> for Atomic

Source§

fn from(year_month_duration: YearMonthDuration) -> Atomic

Converts to this type from the input type.
Source§

impl From<bool> for Atomic

Source§

fn from(b: bool) -> Atomic

Converts to this type from the input type.
Source§

impl From<f32> for Atomic

Source§

fn from(f: f32) -> Atomic

Converts to this type from the input type.
Source§

impl From<f64> for Atomic

Source§

fn from(f: f64) -> Atomic

Converts to this type from the input type.
Source§

impl From<i16> for Atomic

Source§

fn from(i: i16) -> Atomic

Converts to this type from the input type.
Source§

impl From<i32> for Atomic

Source§

fn from(i: i32) -> Atomic

Converts to this type from the input type.
Source§

impl From<i64> for Atomic

Source§

fn from(i: i64) -> Atomic

Converts to this type from the input type.
Source§

impl From<i8> for Atomic

Source§

fn from(i: i8) -> Atomic

Converts to this type from the input type.
Source§

impl From<u16> for Atomic

Source§

fn from(i: u16) -> Atomic

Converts to this type from the input type.
Source§

impl From<u32> for Atomic

Source§

fn from(i: u32) -> Atomic

Converts to this type from the input type.
Source§

impl From<u64> for Atomic

Source§

fn from(i: u64) -> Atomic

Converts to this type from the input type.
Source§

impl From<u8> for Atomic

Source§

fn from(i: u8) -> Atomic

Converts to this type from the input type.
Source§

impl FromIterator<Atomic> for Sequence

Source§

fn from_iter<I>(iter: I) -> Sequence
where I: IntoIterator<Item = Atomic>,

Creates a value from an iterator. Read more
Source§

impl Hash for Atomic

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Atomic

Source§

fn eq(&self, other: &Atomic) -> 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 TryFrom<&Item> for Atomic

Source§

type Error = Error

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

fn try_from(item: &Item) -> Result<Atomic, Error>

Performs the conversion.
Source§

impl TryFrom<Atomic> for Duration

Source§

type Error = Error

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

fn try_from(a: Atomic) -> Result<Duration, <Duration as TryFrom<Atomic>>::Error>

Performs the conversion.
Source§

impl TryFrom<Atomic> for NaiveDateTimeWithOffset

Source§

type Error = Error

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

fn try_from( a: Atomic, ) -> Result<NaiveDateTimeWithOffset, <NaiveDateTimeWithOffset as TryFrom<Atomic>>::Error>

Performs the conversion.
Source§

impl TryFrom<Atomic> for NaiveDateWithOffset

Source§

type Error = Error

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

fn try_from( a: Atomic, ) -> Result<NaiveDateWithOffset, <NaiveDateWithOffset as TryFrom<Atomic>>::Error>

Performs the conversion.
Source§

impl TryFrom<Atomic> for NaiveTimeWithOffset

Source§

type Error = Error

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

fn try_from( a: Atomic, ) -> Result<NaiveTimeWithOffset, <NaiveTimeWithOffset as TryFrom<Atomic>>::Error>

Performs the conversion.
Source§

impl TryFrom<Atomic> for OwnedName

Source§

type Error = Error

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

fn try_from( a: Atomic, ) -> Result<OwnedName, <OwnedName as TryFrom<Atomic>>::Error>

Performs the conversion.
Source§

impl TryFrom<Item> for Atomic

Source§

type Error = Error

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

fn try_from(item: Item) -> Result<Atomic, Error>

Performs the conversion.
Source§

impl Eq for Atomic

Source§

impl StructuralPartialEq for Atomic

Auto Trait Implementations§

§

impl Freeze for Atomic

§

impl RefUnwindSafe for Atomic

§

impl !Send for Atomic

§

impl !Sync for Atomic

§

impl Unpin for Atomic

§

impl UnwindSafe for Atomic

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<'p, T> Seq<'p, T> for T
where T: Clone,

Source§

type Item<'a> = &'a T where T: 'a

The item yielded by the iterator.
Source§

type Iter<'a> = Once<&'a T> where T: 'a

An iterator over the items within this container, by reference.
Source§

fn seq_iter(&self) -> <T as Seq<'p, T>>::Iter<'_>

Iterate over the elements of the container.
Source§

fn contains(&self, val: &T) -> bool
where T: PartialEq,

Check whether an item is contained within this sequence.
Source§

fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>
where 'p: 'b,

Convert an item of the sequence into a MaybeRef.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> OrderedSeq<'_, T> for T
where T: Clone,