Enum Term

Source
pub enum Term {
    OMID(ContentURI),
    OMV(Var),
    OMA {
        head: Box<Term>,
        args: Box<[Arg]>,
    },
    Field {
        record: Box<Term>,
        key: Name,
        owner: Option<Box<Term>>,
    },
    OML {
        name: Name,
        df: Option<Box<Term>>,
        tp: Option<Box<Term>>,
    },
    Informal {
        tag: String,
        attributes: Box<[(Box<str>, Box<str>)]>,
        children: Box<[Informal]>,
        terms: Box<[Term]>,
    },
}

Variantsยง

ยง

OMID(ContentURI)

ยง

OMV(Var)

ยง

OMA

Fields

ยงargs: Box<[Arg]>
ยง

Field

Fields

ยงrecord: Box<Term>
ยง

OML

ยง

Informal

Fields

ยงattributes: Box<[(Box<str>, Box<str>)]>
ยงchildren: Box<[Informal]>
ยงterms: Box<[Term]>

Implementationsยง

Sourceยง

impl Term

Source

pub fn present( &self, presenter: &mut impl Presenter, ) -> Result<(), PresentationError>

ยงErrors
Source

pub fn term_list(i: impl Iterator<Item = Self>) -> Self

Source

pub fn as_list(&self) -> Option<&[Arg]>

Source

pub fn is_record_field(&self) -> bool

Source

pub fn into_record_field(self) -> Result<(Self, Name), Self>

ยงErrors
Source

fn display_top<const SHORT: bool>( &self, f: &mut Formatter<'_>, indent: Option<Indentor<'_>>, ) -> Result

Source

fn display_start<const SHORT: bool>( &self, ind: &mut Indentor<'_>, f: &mut Formatter<'_>, ) -> Result<DFSContinuation<()>, Error>

Source

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

Source

pub fn subterm_iter(&self) -> impl Iterator<Item = &Self>

Source

pub fn uri_iter(&self) -> impl Iterator<Item = URIRef<'_>>

Trait Implementationsยง

Sourceยง

impl Clone for Term

Sourceยง

fn clone(&self) -> Term

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 Term

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<'de> Deserialize<'de> for Term

Sourceยง

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl Display for Term

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl From<Term> for JsValue
where Term: Serialize,

Sourceยง

fn from(value: Term) -> Self

Converts to this type from the input type.
Sourceยง

impl FromWasmAbi for Term
where Self: DeserializeOwned,

Sourceยง

type Abi = <JsType as FromWasmAbi>::Abi

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Sourceยง

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi. Read more
Sourceยง

impl Hash for Term

Sourceยง

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

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 IntoWasmAbi for Term
where Term: Serialize,

Sourceยง

type Abi = <JsType as IntoWasmAbi>::Abi

The Wasm ABI type that this converts into when crossing the ABI boundary.
Sourceยง

fn into_abi(self) -> Self::Abi

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Sourceยง

impl OptionFromWasmAbi for Term
where Self: DeserializeOwned,

Sourceยง

fn is_none(js: &Self::Abi) -> bool

Tests whether the argument is a โ€œnoneโ€ instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Sourceยง

impl OptionIntoWasmAbi for Term
where Term: Serialize,

Sourceยง

fn none() -> Self::Abi

Returns an ABI instance indicating โ€œnoneโ€, which JS will interpret as the None branch of this option. Read more
Sourceยง

impl PartialEq for Term

Sourceยง

fn eq(&self, other: &Term) -> 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 RefFromWasmAbi for Term
where Self: DeserializeOwned,

Sourceยง

type Abi = <JsType as RefFromWasmAbi>::Abi

The Wasm ABI type references to Self are recovered from.
Sourceยง

type Anchor = SelfOwner<Term>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes donโ€™t persist beyond one function call, and so that they remain anonymous.
Sourceยง

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Sourceยง

impl Serialize for Term

Sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl TreeChild<Term> for &Term

Sourceยง

fn children<'b>(&self) -> Option<<Term as TreeLike>::RefIter<'b>>
where Self: 'b,

Sourceยง

impl TreeLike for Term

Sourceยง

type Child<'a> = &'a Term

Sourceยง

type RefIter<'a> = TermChildrenIter<'a>

Sourceยง

fn children(&self) -> Option<Self::RefIter<'_>>

Sourceยง

fn dfs(&self) -> Option<DFSIter<'_, Self>>

Sourceยง

fn bfs(&self) -> Option<BFSIter<'_, Self>>

Sourceยง

fn bfs_par<'a>(&'a self) -> Option<ParSpliter<BFSIter<'a, Self>>>
where Self::Child<'a>: Send, Self::RefIter<'a>: Send,

Sourceยง

fn dfs_with_close<'a, R, SG, SL, Open, Close>( &'a self, state: &mut SG, open: Open, close: Close, ) -> Result<(), R>
where Open: FnMut(&mut SG, Self::Child<'a>) -> Result<DFSContinuation<SL>, R>, Close: FnMut(&mut SG, SL) -> Result<(), R>,

Sourceยง

fn display_nested<'a>( &'a self, f: &mut Formatter<'_>, open: impl Fn(&Self::Child<'a>, &mut Indentor<'_>, &mut Formatter<'_>) -> Result<DFSContinuation<()>, Error>, close: impl Fn(&Self::Child<'a>, &mut Formatter<'_>) -> Result<(), Error>, indent: Option<Indentor<'_>>, ) -> Result<(), Error>

Sourceยง

fn display_children<'a, I>( i: I, f: &mut Formatter<'_>, open: impl Fn(&Self::Child<'a>, &mut Indentor<'_>, &mut Formatter<'_>) -> Result<DFSContinuation<()>, Error>, close: impl Fn(&Self::Child<'a>, &mut Formatter<'_>) -> Result<(), Error>, indent: Option<Indentor<'_>>, ) -> Result<(), Error>
where I: Into<Self::RefIter<'a>>, Self: 'a,

Sourceยง

impl Tsify for Term

Sourceยง

const DECL: &'static str = "export type Term = { OMID: ContentURI } | { OMV: Var } | { OMA: { head: Term; args: Arg[] } } | { Field: { record: Term; key: Name; owner: Term | undefined } } | { OML: { name: Name; df: Term | undefined; tp: Term | undefined } } | { Informal: { tag: string; attributes: [string, string][]; children: Informal[]; terms: Term[] } };"

Sourceยง

const SERIALIZATION_CONFIG: SerializationConfig

Sourceยง

type JsType = JsType

ยง

fn into_js(&self) -> Result<Self::JsType, Error>
where Self: Serialize,

ยง

fn from_js<T>(js: T) -> Result<Self, Error>
where T: Into<JsValue>, Self: DeserializeOwned,

Sourceยง

impl VectorFromWasmAbi for Term
where Self: DeserializeOwned,

Sourceยง

type Abi = <JsType as VectorFromWasmAbi>::Abi

Sourceยง

unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>

Sourceยง

impl VectorIntoWasmAbi for Term
where Term: Serialize,

Sourceยง

type Abi = <JsType as VectorIntoWasmAbi>::Abi

Sourceยง

fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi

Sourceยง

impl WasmDescribe for Term

Sourceยง

impl WasmDescribeVector for Term

Sourceยง

impl Eq for Term

Sourceยง

impl StructuralPartialEq for Term

Auto Trait Implementationsยง

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
ยง

impl<T> ArchivePointee for T

ยง

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
ยง

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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
ยง

impl<T> CallHasher for T
where T: Hash + ?Sized,

ยง

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

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
ยง

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

ยง

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<T> Downcast for T
where T: Any,

ยง

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
ยง

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Anyโ€™s vtable from &Traitโ€™s.
ยง

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Anyโ€™s vtable from &mut Traitโ€™s.
ยง

impl<T> DowncastSend for T
where T: Any + Send,

ยง

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

ยง

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
ยง

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

ยง

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

Checks if this value is equivalent to the given key. Read more
ยง

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

ยง

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> Hexable for T
where T: Serialize + for<'de> Deserialize<'de>,

ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
ยง

impl<T> Pointable for T

ยง

const ALIGN: usize

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
ยง

impl<T> Pointee for T

ยง

type Metadata = ()

The type for metadata in pointers and references to Self.
Sourceยง

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Sourceยง

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Sourceยง

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
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, 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.
ยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Sourceยง

impl<T> CondSerialize for T
where T: Serialize,

Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

ยง

impl<T> ErasedDestructor for T
where T: 'static,

ยง

impl<T> Fruit for T
where T: Send + Downcast,