pub enum OMMaybeForeign<'o, I> {
OM(I),
Foreign {
encoding: Option<Cow<'o, str>>,
value: Cow<'o, str>,
},
}Expand description
Either an OpenMath Expression or an OMFOREIGN.
Generic over the non-OMFOREIGN-case, so it can be used in both OpenMath and OM
Variants§
OM(I)
Foreign
If $A$ is not an OpenMath object, then $\mathrm{foreign}(A)$ is an OpenMath foreign object.
An OpenMath foreign object may optionally have an encoding field which describes how its
contents should be interpreted.
Trait Implementations§
Source§impl<'o, I: Clone> Clone for OMMaybeForeign<'o, I>
impl<'o, I: Clone> Clone for OMMaybeForeign<'o, I>
Source§fn clone(&self) -> OMMaybeForeign<'o, I>
fn clone(&self) -> OMMaybeForeign<'o, I>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'o, I: Debug> Debug for OMMaybeForeign<'o, I>
impl<'o, I: Debug> Debug for OMMaybeForeign<'o, I>
Source§impl<'o, I: Hash> Hash for OMMaybeForeign<'o, I>
impl<'o, I: Hash> Hash for OMMaybeForeign<'o, I>
Source§impl<I: OMSerializable> OMOrForeign for &OMMaybeForeign<'_, I>
impl<I: OMSerializable> OMOrForeign for &OMMaybeForeign<'_, I>
Source§fn om_or_foreign(
self,
) -> Either<impl OMSerializable, (Option<impl Display>, impl Display)>
fn om_or_foreign( self, ) -> Either<impl OMSerializable, (Option<impl Display>, impl Display)>
converts this into an Either(crate::either::Either)
Source§impl<'o, I: PartialEq> PartialEq for OMMaybeForeign<'o, I>
impl<'o, I: PartialEq> PartialEq for OMMaybeForeign<'o, I>
impl<'o, I: Eq> Eq for OMMaybeForeign<'o, I>
impl<'o, I> StructuralPartialEq for OMMaybeForeign<'o, I>
Auto Trait Implementations§
impl<'o, I> Freeze for OMMaybeForeign<'o, I>where
I: Freeze,
impl<'o, I> RefUnwindSafe for OMMaybeForeign<'o, I>where
I: RefUnwindSafe,
impl<'o, I> Send for OMMaybeForeign<'o, I>where
I: Send,
impl<'o, I> Sync for OMMaybeForeign<'o, I>where
I: Sync,
impl<'o, I> Unpin for OMMaybeForeign<'o, I>where
I: Unpin,
impl<'o, I> UnwindSafe for OMMaybeForeign<'o, I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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