Skip to main content

OpObj

Struct OpObj 

Source
pub struct OpObj {
    pub index: u32,
    pub name: String,
    pub doc: String,
    pub args_info: Array<ArgumentInfo>,
    pub ty_args_info: Array<ArgumentInfo>,
    pub var_args_info: Option<ArgumentInfo>,
    pub var_ty_args_info: Option<ArgumentInfo>,
    pub attrs_type_key: String,
    /* private fields */
}
Expand description

The object of an operator registry entry (ir.Op).

Only the registry constructs one: get an operator with Op::get.

Fields§

§index: u32

The dense, process-local index of the operator into the attribute columns; never serialized.

§name: String

The canonical name of the operator, such as "prim.exp".

§doc: String

The documentation of the operator.

§args_info: Array<ArgumentInfo>

The descriptions of the required value arguments, in order.

§ty_args_info: Array<ArgumentInfo>

The descriptions of the required type arguments, in order.

§var_args_info: Option<ArgumentInfo>

The description of the variadic value tail after args_info, if any.

§var_ty_args_info: Option<ArgumentInfo>

The description of the variadic type-argument tail after ty_args_info, if any.

§attrs_type_key: String

The type key of the operator’s Call.attrs, or empty when it declares none.

Implementations§

Source§

impl OpObj

Source

pub fn attrs_type_index(&self) -> u32

Return the runtime type index of attrs_type_key, or 0 when the operator declares no attrs type.

Source

pub fn validator(&self) -> &Any

Return the validator that Call::validate runs: a native function pointer, a packed function, or None.

Source

pub fn validator_is_custom(&self) -> bool

Return whether the validator was set with OpDef::set_validator rather than generated from a signature.

Trait Implementations§

Source§

impl Deref for OpObj

Source§

type Target = ExprObj

The resulting type after dereferencing.
Source§

fn deref(&self) -> &ExprObj

Dereferences the value.
Source§

impl<'a> From<&'a OpObj> for AnyView<'a>

Source§

fn from(value: &'a OpObj) -> Self

Converts to this type from the input type.
Source§

impl ObjectCore for OpObj

Source§

const TYPE_KEY: &'static str = "ir.Op"

The type key, such as "ffi.Array".
Source§

const TYPE_DEPTH: i32

Depth of this type in the object inheritance tree. Read more
Source§

type Parent = ExprObj

The parent’s object type, which Self embeds at offset zero; () for the root Object.
Source§

fn type_index() -> i32

The runtime type index of this type.
Source§

unsafe fn object_header_mut(this: &mut Self) -> &mut TVMFFIObject

The object header, mutably. Read more
Source§

impl ImmutableObject for OpObj

Auto Trait Implementations§

§

impl !Freeze for OpObj

§

impl RefUnwindSafe for OpObj

§

impl Send for OpObj

§

impl Sync for OpObj

§

impl Unpin for OpObj

§

impl UnsafeUnpin for OpObj

§

impl UnwindSafe for OpObj

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> DowncastRefFromAny for T
where T: ObjectCore,

Source§

unsafe fn downcast_ref_from_any(cell: &TVMFFIAny) -> Option<&T>

Borrow cell as Self when it holds one. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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> TypeSubsumes<T> for T
where T: ?Sized,