Skip to main content

OpType

Enum OpType 

Source
#[non_exhaustive]
pub enum OpType {
Show 22 variants Module(Module), FuncDefn(FuncDefn), FuncDecl(FuncDecl), AliasDecl(AliasDecl), AliasDefn(AliasDefn), Const(Const), Input(Input), Output(Output), Call(Call), CallIndirect(CallIndirect), LoadConstant(LoadConstant), LoadFunction(LoadFunction), DFG(DFG), ExtensionOp(ExtensionOp), OpaqueOp(OpaqueOp), Tag(Tag), DataflowBlock(DataflowBlock), ExitBlock(ExitBlock), TailLoop(TailLoop), CFG(CFG), Conditional(Conditional), Case(Case),
}
Expand description

The concrete operation types for a node in the HUGR.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Module(Module)

§

FuncDefn(FuncDefn)

§

FuncDecl(FuncDecl)

§

AliasDecl(AliasDecl)

§

AliasDefn(AliasDefn)

§

Const(Const)

§

Input(Input)

§

Output(Output)

§

Call(Call)

§

CallIndirect(CallIndirect)

§

LoadConstant(LoadConstant)

§

LoadFunction(LoadFunction)

§

DFG(DFG)

§

ExtensionOp(ExtensionOp)

§

OpaqueOp(OpaqueOp)

§

Tag(Tag)

§

DataflowBlock(DataflowBlock)

§

ExitBlock(ExitBlock)

§

TailLoop(TailLoop)

§

CFG(CFG)

§

Conditional(Conditional)

§

Case(Case)

Implementations§

Source§

impl OpType

Source

pub fn as_module(&self) -> Option<&Module>

If is an instance of Module return a reference to it.

Source

pub fn is_module(&self) -> bool

Returns true if the operation is an instance of Module.

Source§

impl OpType

Source

pub fn as_func_defn(&self) -> Option<&FuncDefn>

If is an instance of FuncDefn return a reference to it.

Source

pub fn is_func_defn(&self) -> bool

Returns true if the operation is an instance of FuncDefn.

Source§

impl OpType

Source

pub fn as_func_decl(&self) -> Option<&FuncDecl>

If is an instance of FuncDecl return a reference to it.

Source

pub fn is_func_decl(&self) -> bool

Returns true if the operation is an instance of FuncDecl.

Source§

impl OpType

Source

pub fn as_alias_decl(&self) -> Option<&AliasDecl>

If is an instance of AliasDecl return a reference to it.

Source

pub fn is_alias_decl(&self) -> bool

Returns true if the operation is an instance of AliasDecl.

Source§

impl OpType

Source

pub fn as_alias_defn(&self) -> Option<&AliasDefn>

If is an instance of AliasDefn return a reference to it.

Source

pub fn is_alias_defn(&self) -> bool

Returns true if the operation is an instance of AliasDefn.

Source§

impl OpType

Source

pub fn as_const(&self) -> Option<&Const>

If is an instance of Const return a reference to it.

Source

pub fn is_const(&self) -> bool

Returns true if the operation is an instance of Const.

Source§

impl OpType

Source

pub fn as_input(&self) -> Option<&Input>

If is an instance of Input return a reference to it.

Source

pub fn is_input(&self) -> bool

Returns true if the operation is an instance of Input.

Source§

impl OpType

Source

pub fn as_output(&self) -> Option<&Output>

If is an instance of Output return a reference to it.

Source

pub fn is_output(&self) -> bool

Returns true if the operation is an instance of Output.

Source§

impl OpType

Source

pub fn as_call(&self) -> Option<&Call>

If is an instance of Call return a reference to it.

Source

pub fn is_call(&self) -> bool

Returns true if the operation is an instance of Call.

Source§

impl OpType

Source

pub fn as_call_indirect(&self) -> Option<&CallIndirect>

If is an instance of CallIndirect return a reference to it.

Source

pub fn is_call_indirect(&self) -> bool

Returns true if the operation is an instance of CallIndirect.

Source§

impl OpType

Source

pub fn as_load_constant(&self) -> Option<&LoadConstant>

If is an instance of LoadConstant return a reference to it.

Source

pub fn is_load_constant(&self) -> bool

Returns true if the operation is an instance of LoadConstant.

Source§

impl OpType

Source

pub fn as_load_function(&self) -> Option<&LoadFunction>

If is an instance of LoadFunction return a reference to it.

Source

pub fn is_load_function(&self) -> bool

Returns true if the operation is an instance of LoadFunction.

Source§

impl OpType

Source

pub fn as_dfg(&self) -> Option<&DFG>

If is an instance of DFG return a reference to it.

Source

pub fn is_dfg(&self) -> bool

Returns true if the operation is an instance of DFG.

Source§

impl OpType

Source

pub fn as_extension_op(&self) -> Option<&ExtensionOp>

If is an instance of ExtensionOp return a reference to it.

Source

pub fn is_extension_op(&self) -> bool

Returns true if the operation is an instance of ExtensionOp.

Source§

impl OpType

Source

pub fn as_tag(&self) -> Option<&Tag>

If is an instance of Tag return a reference to it.

Source

pub fn is_tag(&self) -> bool

Returns true if the operation is an instance of Tag.

Source§

impl OpType

Source

pub fn as_dataflow_block(&self) -> Option<&DataflowBlock>

If is an instance of DataflowBlock return a reference to it.

Source

pub fn is_dataflow_block(&self) -> bool

Returns true if the operation is an instance of DataflowBlock.

Source§

impl OpType

Source

pub fn as_exit_block(&self) -> Option<&ExitBlock>

If is an instance of ExitBlock return a reference to it.

Source

pub fn is_exit_block(&self) -> bool

Returns true if the operation is an instance of ExitBlock.

Source§

impl OpType

Source

pub fn as_tail_loop(&self) -> Option<&TailLoop>

If is an instance of TailLoop return a reference to it.

Source

pub fn is_tail_loop(&self) -> bool

Returns true if the operation is an instance of TailLoop.

Source§

impl OpType

Source

pub fn as_cfg(&self) -> Option<&CFG>

If is an instance of CFG return a reference to it.

Source

pub fn is_cfg(&self) -> bool

Returns true if the operation is an instance of CFG.

Source§

impl OpType

Source

pub fn as_conditional(&self) -> Option<&Conditional>

If is an instance of Conditional return a reference to it.

Source

pub fn is_conditional(&self) -> bool

Returns true if the operation is an instance of Conditional.

Source§

impl OpType

Source

pub fn as_case(&self) -> Option<&Case>

If is an instance of Case return a reference to it.

Source

pub fn is_case(&self) -> bool

Returns true if the operation is an instance of Case.

Source§

impl OpType

Source

pub fn other_port_kind(&self, dir: Direction) -> Option<EdgeKind>

The edge kind for the non-dataflow ports of the operation, not described by the signature.

If not None, a single extra port of that kind will be present on the given direction after any dataflow or constant ports.

Source

pub fn static_port_kind(&self, dir: Direction) -> Option<EdgeKind>

The edge kind for the static ports of the operation, not described by the dataflow signature.

If not None, an extra input port of that kind will be present on the given direction after any dataflow ports and before any OpType::other_port_kind ports.

Source

pub fn port_kind(&self, port: impl Into<Port>) -> Option<EdgeKind>

Returns the edge kind for the given port.

The result may be a value port, a static port, or a non-dataflow port. See OpType::dataflow_signature, OpType::static_port_kind, and OpType::other_port_kind.

Source

pub fn other_port(&self, dir: Direction) -> Option<Port>

The non-dataflow port for the operation, not described by the signature. See [OpType::other_port_kind].

Returns None if there is no such port, or if the operation defines multiple non-dataflow ports.

Source

pub fn other_input_port(&self) -> Option<IncomingPort>

The non-dataflow input port for the operation, not described by the signature. See [OpType::other_port].

Source

pub fn other_output_port(&self) -> Option<OutgoingPort>

The non-dataflow output port for the operation, not described by the signature. See [OpType::other_port].

Source

pub fn static_port(&self, dir: Direction) -> Option<Port>

If the op has a static port, the port of that input.

See OpType::static_input_port and OpType::static_output_port.

Source

pub fn static_input_port(&self) -> Option<IncomingPort>

If the op has a static input (Call, LoadConstant, and LoadFunction), the port of that input.

Source

pub fn static_output_port(&self) -> Option<OutgoingPort>

If the op has a static output (Const, FuncDefn, FuncDecl), the port of that output.

Source

pub fn value_ports(&self, dir: Direction) -> impl DoubleEndedIterator

Return the dataflow value ports for the given direction.

See OpType::value_input_ports and OpType::value_output_ports.

Source

pub fn value_input_ports(&self) -> impl DoubleEndedIterator

Return the dataflow value input ports for the given direction.

Source

pub fn value_output_ports(&self) -> impl DoubleEndedIterator

Return the dataflow value output ports for the given direction.

Source

pub fn value_port_count(&self, dir: Direction) -> usize

The number of Value ports in given direction.

Source

pub fn value_input_count(&self) -> usize

The number of Value input ports.

Source

pub fn value_output_count(&self) -> usize

The number of Value output ports.

Source

pub fn port_count(&self, dir: Direction) -> usize

Returns the number of ports for the given direction.

Source

pub fn input_count(&self) -> usize

Returns the number of inputs ports for the operation.

Source

pub fn output_count(&self) -> usize

Returns the number of outputs ports for the operation.

Source

pub fn is_container(&self) -> bool

Checks whether the operation can contain children nodes.

Source

pub fn cast<T>(&self) -> Option<T>
where T: MakeExtensionOp,

Cast to an extension operation.

Returns None if the operation is not of the requested type.

Source

pub fn extension_id(&self) -> Option<&IdentList>

Returns the extension where the operation is defined, if any.

Source

pub fn used_extensions( &self, ) -> Result<ExtensionRegistry, ExtensionCollectionError>

Returns a registry with all the extensions required by the operation.

This includes the operation extension in OpType::extension_id, and any extension required by the operation’s signature types.

Trait Implementations§

Source§

impl Clone for OpType

Source§

fn clone(&self) -> OpType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for OpType

Source§

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

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

impl Default for OpType

Source§

fn default() -> OpType

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OpType

Source§

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

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

impl Display for OpType

Source§

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

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

impl From<AliasDecl> for OpType

Source§

fn from(v: AliasDecl) -> OpType

Converts to this type from the input type.
Source§

impl From<AliasDefn> for OpType

Source§

fn from(v: AliasDefn) -> OpType

Converts to this type from the input type.
Source§

impl From<CFG> for OpType

Source§

fn from(v: CFG) -> OpType

Converts to this type from the input type.
Source§

impl From<Call> for OpType

Source§

fn from(v: Call) -> OpType

Converts to this type from the input type.
Source§

impl From<CallIndirect> for OpType

Source§

fn from(v: CallIndirect) -> OpType

Converts to this type from the input type.
Source§

impl From<Case> for OpType

Source§

fn from(v: Case) -> OpType

Converts to this type from the input type.
Source§

impl From<Conditional> for OpType

Source§

fn from(v: Conditional) -> OpType

Converts to this type from the input type.
Source§

impl From<Const> for OpType

Source§

fn from(v: Const) -> OpType

Converts to this type from the input type.
Source§

impl From<DFG> for OpType

Source§

fn from(v: DFG) -> OpType

Converts to this type from the input type.
Source§

impl From<DataflowBlock> for OpType

Source§

fn from(v: DataflowBlock) -> OpType

Converts to this type from the input type.
Source§

impl From<ExitBlock> for OpType

Source§

fn from(v: ExitBlock) -> OpType

Converts to this type from the input type.
Source§

impl From<ExtensionOp> for OpType

Source§

fn from(v: ExtensionOp) -> OpType

Converts to this type from the input type.
Source§

impl From<FuncDecl> for OpType

Source§

fn from(v: FuncDecl) -> OpType

Converts to this type from the input type.
Source§

impl From<FuncDefn> for OpType

Source§

fn from(v: FuncDefn) -> OpType

Converts to this type from the input type.
Source§

impl From<Input> for OpType

Source§

fn from(v: Input) -> OpType

Converts to this type from the input type.
Source§

impl From<LoadConstant> for OpType

Source§

fn from(v: LoadConstant) -> OpType

Converts to this type from the input type.
Source§

impl From<LoadFunction> for OpType

Source§

fn from(v: LoadFunction) -> OpType

Converts to this type from the input type.
Source§

impl From<Module> for OpType

Source§

fn from(v: Module) -> OpType

Converts to this type from the input type.
Source§

impl From<OpaqueOp> for OpType

Source§

fn from(v: OpaqueOp) -> OpType

Converts to this type from the input type.
Source§

impl From<Output> for OpType

Source§

fn from(v: Output) -> OpType

Converts to this type from the input type.
Source§

impl<T> From<T> for OpType

Source§

fn from(ext_op: T) -> OpType

Convert

Source§

impl From<Tag> for OpType

Source§

fn from(v: Tag) -> OpType

Converts to this type from the input type.
Source§

impl From<TailLoop> for OpType

Source§

fn from(v: TailLoop) -> OpType

Converts to this type from the input type.
Source§

impl OpParent for OpType

Source§

fn inner_function_type(&self) -> Option<Cow<'_, FuncTypeBase<TypeRow>>>

The inner function type of the operation, if it has a child dataflow sibling graph.

Non-container ops like FuncDecl return None even though they represent a function.

Source§

impl OpTrait for OpType

Source§

fn description(&self) -> &str

A human-readable description of the operation.

Source§

fn tag(&self) -> OpTag

Tag identifying the operation.

Source§

fn try_node_handle<N, H>(&self, __enum_dispatch_arg_0: N) -> Option<H>
where N: HugrNode, H: NodeHandle<N> + From<N>,

Tries to create a specific NodeHandle for a node with this operation type.

Fails if the operation’s OpTrait::tag does not match the NodeHandle::TAG of the requested handle.

Source§

fn dataflow_signature(&self) -> Option<Cow<'_, FuncTypeBase<TypeRow>>>

The signature of the operation.

Only dataflow operations have a signature, otherwise returns None.

Source§

fn other_input(&self) -> Option<EdgeKind>

The edge kind for the non-dataflow inputs of the operation, not described by the signature.

If not None, a single extra input port of that kind will be present.

Source§

fn other_output(&self) -> Option<EdgeKind>

The edge kind for the non-dataflow outputs of the operation, not described by the signature.

If not None, a single extra output port of that kind will be present.

Source§

fn static_input(&self) -> Option<EdgeKind>

The edge kind for a single constant input of the operation, not described by the dataflow signature.

If not None, an extra input port of that kind will be present after the dataflow input ports and before any OpTrait::other_input ports.

Source§

fn static_output(&self) -> Option<EdgeKind>

The edge kind for a single constant output of the operation, not described by the dataflow signature.

If not None, an extra output port of that kind will be present after the dataflow input ports and before any OpTrait::other_output ports.

Source§

fn non_df_port_count(&self, __enum_dispatch_arg_0: Direction) -> usize

Get the number of non-dataflow multiports.

Source§

fn substitute(&self, __enum_dispatch_arg_0: &Substitution<'_>) -> OpType

Apply a type-level substitution to this OpType, i.e. replace type variables with new types.

Source§

impl PartialEq for OpType

Source§

fn eq(&self, other: &OpType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 PartialOrd for OpType

Source§

fn partial_cmp(&self, other: &OpType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for OpType

Source§

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

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

impl StructuralPartialEq for OpType

Source§

impl TryInto<AliasDecl> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<AliasDecl, <OpType as TryInto<AliasDecl>>::Error>

Performs the conversion.
Source§

impl TryInto<AliasDefn> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<AliasDefn, <OpType as TryInto<AliasDefn>>::Error>

Performs the conversion.
Source§

impl TryInto<CFG> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<CFG, <OpType as TryInto<CFG>>::Error>

Performs the conversion.
Source§

impl TryInto<Call> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Call, <OpType as TryInto<Call>>::Error>

Performs the conversion.
Source§

impl TryInto<CallIndirect> for OpType

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<CallIndirect, <OpType as TryInto<CallIndirect>>::Error>

Performs the conversion.
Source§

impl TryInto<Case> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Case, <OpType as TryInto<Case>>::Error>

Performs the conversion.
Source§

impl TryInto<Conditional> for OpType

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<Conditional, <OpType as TryInto<Conditional>>::Error>

Performs the conversion.
Source§

impl TryInto<Const> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Const, <OpType as TryInto<Const>>::Error>

Performs the conversion.
Source§

impl TryInto<DFG> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<DFG, <OpType as TryInto<DFG>>::Error>

Performs the conversion.
Source§

impl TryInto<DataflowBlock> for OpType

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<DataflowBlock, <OpType as TryInto<DataflowBlock>>::Error>

Performs the conversion.
Source§

impl TryInto<ExitBlock> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<ExitBlock, <OpType as TryInto<ExitBlock>>::Error>

Performs the conversion.
Source§

impl TryInto<ExtensionOp> for OpType

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<ExtensionOp, <OpType as TryInto<ExtensionOp>>::Error>

Performs the conversion.
Source§

impl TryInto<FuncDecl> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<FuncDecl, <OpType as TryInto<FuncDecl>>::Error>

Performs the conversion.
Source§

impl TryInto<FuncDefn> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<FuncDefn, <OpType as TryInto<FuncDefn>>::Error>

Performs the conversion.
Source§

impl TryInto<Input> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Input, <OpType as TryInto<Input>>::Error>

Performs the conversion.
Source§

impl TryInto<LoadConstant> for OpType

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<LoadConstant, <OpType as TryInto<LoadConstant>>::Error>

Performs the conversion.
Source§

impl TryInto<LoadFunction> for OpType

Source§

type Error = &'static str

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

fn try_into( self, ) -> Result<LoadFunction, <OpType as TryInto<LoadFunction>>::Error>

Performs the conversion.
Source§

impl TryInto<Module> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Module, <OpType as TryInto<Module>>::Error>

Performs the conversion.
Source§

impl TryInto<OpaqueOp> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<OpaqueOp, <OpType as TryInto<OpaqueOp>>::Error>

Performs the conversion.
Source§

impl TryInto<Output> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Output, <OpType as TryInto<Output>>::Error>

Performs the conversion.
Source§

impl TryInto<Tag> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<Tag, <OpType as TryInto<Tag>>::Error>

Performs the conversion.
Source§

impl TryInto<TailLoop> for OpType

Source§

type Error = &'static str

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

fn try_into(self) -> Result<TailLoop, <OpType as TryInto<TailLoop>>::Error>

Performs the conversion.
Source§

impl ValidateOp for OpType

Source§

fn validity_flags<N>(&self) -> OpValidityFlags<N>
where N: HugrNode,

Returns a set of flags describing the validity predicates for this operation.

Source§

fn validate_op_children<'a, N>( &self, __enum_dispatch_arg_0: impl DoubleEndedIterator<Item = (N, &'a OpType)>, ) -> Result<(), ChildrenValidationError<N>>
where N: HugrNode,

Validate the ordered list of children.

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
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Convert<&Arc<T>> for T
where T: Clone,

Source§

fn convert(source: &Arc<T>) -> T

Source§

impl<T> Convert<&Rc<T>> for T
where T: Clone,

Source§

fn convert(source: &Rc<T>) -> T

Source§

impl<T> Convert<&T> for T
where T: Clone,

Source§

fn convert(source: &T) -> T

Source§

impl<T> Convert<T> for T

Source§

fn convert(source: T) -> T

Source§

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

Source§

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

Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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

Source§

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.
Source§

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

Source§

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.
Source§

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.
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> ToSmolStr for T
where T: Display + ?Sized,

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> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
Source§

impl<'a, S, T> View<'a, &S> for T
where T: View<'a, S>, S: Copy,

Source§

fn view(module: &'a Module<'a>, id: &S) -> Option<T>

Attempt to interpret a subpart of a module as this type.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more