Skip to main content

MutationSpec

Enum MutationSpec 

Source
pub enum MutationSpec {
Show 51 variants Rename { target: MutationTargetSymbol, to: String, scope: Scope, }, AddField { target: MutationTargetSymbol, field_name: String, field_type: String, visibility: Visibility, }, RemoveField { target: MutationTargetSymbol, field_name: String, }, ChangeVisibility { target: MutationTargetSymbol, visibility: Visibility, }, AddDerive { target: MutationTargetSymbol, derives: Vec<String>, }, RemoveDerive { target: MutationTargetSymbol, derives: Vec<String>, }, AddVariant { target: MutationTargetSymbol, variant_name: String, variant_kind: VariantKind, }, RemoveVariant { target: MutationTargetSymbol, variant_name: String, }, AddMatchArm { target: MutationTargetSymbol, enum_name: String, pattern: String, body: String, }, RemoveMatchArm { target: MutationTargetSymbol, enum_name: String, pattern: String, }, ReplaceMatchArm { target: MutationTargetSymbol, enum_name: String, old_pattern: String, new_pattern: String, new_body: String, }, AddStructLiteralField { target: MutationTargetSymbol, field_name: String, value: String, }, RemoveStructLiteralField { target: MutationTargetSymbol, field_name: String, }, AddItem { target: MutationTargetSymbol, content: String, position: InsertPosition, }, RemoveItem { target: MutationTargetSymbol, item_kind: ItemKind, }, AddSpec { type_id: SymbolId, module_id: SymbolId, group: String, alias_name: Option<String>, relations: Vec<SpecRelation>, }, RemoveSpec { type_id: SymbolId, module_id: SymbolId, }, ValidateSpec { type_ids: Vec<SymbolId>, expected_group: Option<String>, validate_relations: bool, }, AddMethod { target: MutationTargetSymbol, method_name: String, params: Vec<(String, String)>, return_type: Option<String>, body: String, is_pub: bool, self_param: Option<SelfParam>, }, RemoveMethod { target: MutationTargetSymbol, method_name: String, }, RemoveMod { target: MutationTargetSymbol, mod_name: String, }, CreateMod { target: MutationTargetSymbol, mod_name: String, content: String, is_pub: bool, }, OrganizeImports { module_id: Option<SymbolId>, deduplicate: bool, merge_groups: bool, }, LoopToIterator { module_id: Option<SymbolId>, target_var: Option<String>, }, UnwrapToQuestion { module_id: Option<SymbolId>, target_fn: Option<SymbolId>, include_expect: bool, }, AssignOp { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, }, BoolSimplify { module_id: Option<SymbolId>, }, CloneOnCopy { module_id: Option<SymbolId>, }, CollapsibleIf { module_id: Option<SymbolId>, }, NoOpArmToTodo { module_id: Option<SymbolId>, replacement: String, }, ComparisonToMethod { module_id: Option<SymbolId>, }, RedundantClosure { module_id: Option<SymbolId>, }, IntroduceVariable { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, expr: String, var_name: String, }, ManualMap { module_id: Option<SymbolId>, }, MatchToIfLet { module_id: Option<SymbolId>, }, FilterNext { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, }, MapUnwrapOr { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, }, ReplaceExpr { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, old_expr: String, new_expr: String, replace_all: bool, symbol_path: Option<String>, }, RemoveStatement { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, pattern: String, remove_all: bool, symbol_path: Option<String>, }, InsertStatement { module_id: Option<SymbolId>, fn_id: SymbolId, stmt: String, position: StmtInsertPosition, reference_pattern: Option<String>, symbol_path: Option<String>, }, ReplaceStatement { module_id: Option<SymbolId>, fn_id: Option<SymbolId>, old_stmt: String, new_stmt: String, symbol_path: Option<String>, }, ExtractTrait { target: MutationTargetSymbol, trait_name: String, methods: Option<Vec<String>>, }, InlineTrait { target: MutationTargetSymbol, struct_name: String, remove_trait: bool, }, ReplaceType { target: MutationTargetSymbol, to_type: TypeTransform, scope: Option<SymbolPath>, contexts: Option<Vec<TypeContext>>, }, EnumToTrait { target: MutationTargetSymbol, trait_name: Option<String>, remove_enum: bool, strategy: EnumToTraitStrategy, match_handling: MatchHandling, }, MoveItem { source: MutationTargetSymbol, target: MutationTargetSymbol, item_name: String, item_kind: ItemKind, add_use: bool, }, PluginTransform { plugin_name: String, target_id: Option<SymbolId>, file_patterns: Vec<String>, config: Value, }, DuplicateFunction { target: MutationTargetSymbol, to: String, }, DuplicateStruct { target: MutationTargetSymbol, to: String, include_impls: bool, }, DuplicateEnum { target: MutationTargetSymbol, to: String, include_impls: bool, }, DuplicateModTree { target: MutationTargetSymbol, to: String, },
}
Expand description

Atomic mutation specification

Variants§

§

Rename

Rename an identifier across scope

Fields

§target: MutationTargetSymbol

Target symbol (supports lazy resolution)

§to: String

New name to rename to

§scope: Scope
§

AddField

Add a field to a struct

Fields

§target: MutationTargetSymbol

Target struct (supports lazy resolution)

§field_name: String
§field_type: String
§visibility: Visibility
§

RemoveField

Remove a field from a struct

Fields

§target: MutationTargetSymbol

Target struct (supports lazy resolution)

§field_name: String
§

ChangeVisibility

Change visibility of an item or struct field

Fields

§target: MutationTargetSymbol

Target symbol (supports lazy resolution)

§visibility: Visibility
§

AddDerive

Add derive macros to a type

Fields

§target: MutationTargetSymbol

Target type (supports lazy resolution)

§derives: Vec<String>
§

RemoveDerive

Remove derive macros from a type

Fields

§target: MutationTargetSymbol

Target type (supports lazy resolution)

§derives: Vec<String>
§

AddVariant

Add a variant to an enum

Fields

§target: MutationTargetSymbol

Target enum (supports lazy resolution)

§variant_name: String
§variant_kind: VariantKind
§

RemoveVariant

Remove a variant from an enum

Fields

§target: MutationTargetSymbol

Target enum (supports lazy resolution)

§variant_name: String
§

AddMatchArm

Add a match arm to a match expression

Used to fix exhaustiveness errors when adding enum variants.

Fields

§target: MutationTargetSymbol

Target function/method containing the match expression

§enum_name: String

Enum type being matched (for validation)

§pattern: String

Pattern for the new arm (e.g., “Status::Cancelled”)

§body: String

Body of the new arm (e.g., “todo!()”)

§

RemoveMatchArm

Remove a match arm from a match expression

Used to remove arms when deleting enum variants.

Fields

§target: MutationTargetSymbol

Target function/method containing the match expression

§enum_name: String

Enum type being matched (for validation)

§pattern: String

Pattern to remove (e.g., “Status::Completed”)

§

ReplaceMatchArm

Replace a match arm (pattern + body) in a match expression

Unlike ReplaceExpr which only replaces the body, this replaces both the pattern and body atomically. Useful when pattern bindings need to change along with the body.

Fields

§target: MutationTargetSymbol

Target function/method containing the match expression

§enum_name: String

Enum type being matched (for validation)

§old_pattern: String

Pattern to find and replace (e.g., “PathSegment::Slice { start: _, end: _ }”)

§new_pattern: String

New pattern (e.g., “PathSegment::Slice { start, end }”)

§new_body: String

New body expression

§

AddStructLiteralField

Add a field to all struct literals of a given type

Used to fix missing field errors when adding struct fields.

Fields

§target: MutationTargetSymbol

Target struct (supports lazy resolution)

§field_name: String

Field name to add

§value: String

Value expression (e.g., “None”, “Default::default()”)

§

RemoveStructLiteralField

Remove a field from all struct literals of a given type

Used to update struct literals when removing struct fields.

Fields

§target: MutationTargetSymbol

Target struct (supports lazy resolution)

§field_name: String

Field name to remove

§

AddItem

Add an item (struct, fn, impl, etc.)

Fields

§target: MutationTargetSymbol

Target module (supports lazy resolution)

§content: String

Item content (Rust code)

§position: InsertPosition

Insert position within the module

§

RemoveItem

Remove an item

Fields

§target: MutationTargetSymbol

Target item (supports lazy resolution)

§item_kind: ItemKind
§

AddSpec

Add a Spec TypeAlias (Spec<Group, T> or SpecWith<Group, R, T>)

Fields

§type_id: SymbolId

SymbolId of the target type (required, O(1) lookup)

§module_id: SymbolId

SymbolId of the module to add the type alias (required, O(1) lookup)

§group: String

Group name (e.g., “ConfigGroup”, “DomainGroup”)

§alias_name: Option<String>

Optional alias name (default: “{target}Spec”)

§relations: Vec<SpecRelation>

Relations (up to 3)

§

RemoveSpec

Remove a Spec TypeAlias

Fields

§type_id: SymbolId

SymbolId of the spec alias to remove (required, O(1) lookup)

§module_id: SymbolId

SymbolId of the module containing the spec alias (required, O(1) lookup)

§

ValidateSpec

Validate existing Spec definitions

Fields

§type_ids: Vec<SymbolId>

Target modules as SymbolIds

§expected_group: Option<String>

Expected group name (None = any group)

§validate_relations: bool

Check that relations are valid (targets exist)

§

AddMethod

Add a method to an impl block

Fields

§target: MutationTargetSymbol

Target impl block (supports lazy resolution)

§method_name: String

Method name

§params: Vec<(String, String)>

Parameters as (name, type) pairs

§return_type: Option<String>

Return type (None for unit)

§body: String

Method body expression

§is_pub: bool

Whether the method is public

§self_param: Option<SelfParam>

Self parameter: “ref” (&self), “mut” (&mut self), “owned” (self), or None

§

RemoveMethod

Remove a method from an impl block

Fields

§target: MutationTargetSymbol

Target impl block (supports lazy resolution)

§method_name: String

Method name to remove

§

RemoveMod

Remove a module declaration

Fields

§target: MutationTargetSymbol

Target parent module (supports lazy resolution)

§mod_name: String

Module name to remove

§

CreateMod

Create a new module (adds to module tree)

Fields

§target: MutationTargetSymbol

Target parent module (supports lazy resolution)

§mod_name: String

New module name

§content: String

Initial content (optional)

§is_pub: bool

Whether the module is public

§

OrganizeImports

Organize imports (sort, dedupe, merge)

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§deduplicate: bool
§merge_groups: bool
§

LoopToIterator

Convert loop to iterator

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§target_var: Option<String>
§

UnwrapToQuestion

Convert unwrap/expect to ? operator

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§target_fn: Option<SymbolId>

Only apply in specific function (None = all functions)

§include_expect: bool
§

AssignOp

Simplify assign operations: a = a + ba += b

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§fn_id: Option<SymbolId>

Only apply in specific function (None = all functions)

§

BoolSimplify

Simplify boolean comparisons: x == truex, x == false!x

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

CloneOnCopy

Remove redundant .clone() on Copy types

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

CollapsibleIf

Merge nested if statements into single if with &&

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

NoOpArmToTodo

Replace empty/noop match arms with todo!/unimplemented!/unreachable! _ => {}_ => todo!() or _ => unreachable!()

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§replacement: String

Replacement macro: “todo”, “unimplemented”, or “unreachable” (default: “todo”)

§

ComparisonToMethod

Convert comparisons to method calls: s == ""s.is_empty()

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

RedundantClosure

Remove redundant closures: |x| f(x)f

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

IntroduceVariable

Introduce variable for repeated expressions Expression is specified as string and parsed at runtime

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§fn_id: Option<SymbolId>

Target function to apply (None = all functions)

§expr: String

Expression to extract (as Rust code string, e.g. “a + b * c”)

§var_name: String

Name for the new variable

§

ManualMap

Convert manual match on Option to .map(): match opt { Some(x) => Some(f(x)), None => None }opt.map(f)

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

MatchToIfLet

Convert simple match to if let

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§

FilterNext

Convert .filter().next() to .find()

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§fn_id: Option<SymbolId>

Target function (None = all functions)

§

MapUnwrapOr

Convert .map().unwrap_or() to .map_or()

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§fn_id: Option<SymbolId>

Target function (None = all functions)

§

ReplaceExpr

Replace an expression with another expression

Target can be specified by:

  • old_expr: Pattern matching (searches for matching expressions)
  • symbol_path: Direct position (e.g., “crate::fn::$body::0::1”)

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§old_expr: String

Expression to replace (as Rust code string) - pattern match mode

§new_expr: String

Replacement expression (as Rust code string)

§replace_all: bool

Replace all occurrences (default: true)

§symbol_path: Option<String>

Direct position (e.g., “my_crate::my_fn::$body::0::1::2”) When specified, ignores old_expr and replaces at this exact position

§

RemoveStatement

Remove statements matching a pattern

Target can be specified by:

  • pattern: Pattern matching (searches for matching statements)
  • symbol_path: Direct position (e.g., “crate::fn::$body::2”)

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§pattern: String

Statement pattern to remove (as Rust code string, e.g. “println!(..)”) - pattern match mode

§remove_all: bool

Remove all occurrences (default: true)

§symbol_path: Option<String>

Direct position (e.g., “my_crate::my_fn::$body::2”) When specified, ignores pattern and removes at this exact position

§

InsertStatement

Insert a statement at a specific position

Position can be specified by:

  • position + reference_pattern: Traditional mode
  • symbol_path: Direct position (inserts after $body::N)

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§fn_id: SymbolId

Target function

§stmt: String

Statement to insert (as Rust code string)

§position: StmtInsertPosition

Insert position

§reference_pattern: Option<String>

Reference pattern for BeforePattern/AfterPattern positions

§symbol_path: Option<String>

Direct position (e.g., “my_crate::my_fn::$body::2”) When specified, ignores position and inserts after this statement

§

ReplaceStatement

Replace a statement with another statement

Target can be specified by:

  • old_stmt: Pattern matching (searches for matching statements)
  • symbol_path: Direct position (e.g., “crate::fn::$body::1”)

Fields

§module_id: Option<SymbolId>

Target module (None = all modules)

§old_stmt: String

Statement to replace (as Rust code string) - pattern match mode

§new_stmt: String

Replacement statement (as Rust code string)

§symbol_path: Option<String>

Direct position (e.g., “my_crate::my_fn::$body::1”) When specified, ignores old_stmt and replaces at this exact position

§

ExtractTrait

Extract a trait from an impl block

Fields

§target: MutationTargetSymbol

Target impl block (supports lazy resolution)

§trait_name: String

Name for the new trait

§methods: Option<Vec<String>>

Optional: specific methods to extract (None = all)

§

InlineTrait

Inline a trait back into inherent impl

Fields

§target: MutationTargetSymbol

Target trait (supports lazy resolution)

§struct_name: String

Struct that implements the trait

§remove_trait: bool

Whether to remove the trait definition

§

ReplaceType

Replace all occurrences of a type with a transformed type

§Examples

// Replace Status with Box<dyn Status>
MutationSpec::ReplaceType {
    from_type: "Status".to_string(),
    to_type: TypeTransform::BoxDyn { trait_name: "Status".to_string() },
    scope: None,
    contexts: None,
}

Fields

§target: MutationTargetSymbol

Target type to replace (supports lazy resolution)

§to_type: TypeTransform

How to transform the type

§scope: Option<SymbolPath>

Scope to limit replacements (None = entire crate)

§contexts: Option<Vec<TypeContext>>

Which contexts to replace in (None = all contexts)

§

EnumToTrait

Convert an enum to a trait with struct implementations

Transforms:

  • enum Status { Running, Stopped } into:
  • pub trait Status {}
  • pub struct Running;
  • pub struct Stopped;
  • impl Status for Running {}
  • impl Status for Stopped {}

Also updates all usage sites: Status::RunningRunning

§Type Replacement

With strategy: dynamic (default):

  • fn process(status: Status)fn process(status: Box<dyn Status>)

With strategy: static:

  • fn process(status: Status)fn process(status: impl Status)

With strategy: marker_only:

  • No type replacement (manual migration required)

Fields

§target: MutationTargetSymbol

Target enum (supports lazy resolution)

§trait_name: Option<String>

Optional: custom trait name (default: same as enum name)

§remove_enum: bool

Whether to remove the original enum (default: true)

§strategy: EnumToTraitStrategy

Type replacement strategy (default: dynamic = Box)

§match_handling: MatchHandling

How to handle match expressions (default: warn_only)

§

MoveItem

Move an item from one file to another

Fields

§source: MutationTargetSymbol

Source module (supports lazy resolution)

§target: MutationTargetSymbol

Target module (supports lazy resolution)

§item_name: String

Item name to move

§item_kind: ItemKind

Item kind (Struct, Enum, Fn, etc.)

§add_use: bool

Whether to add use statement in source file

§

PluginTransform

Execute a WASM plugin transform

Fields

§plugin_name: String

Plugin name (e.g., “map-unwrap-or”, “custom-lint”)

§target_id: Option<SymbolId>

Target module as SymbolId (None = all modules)

§file_patterns: Vec<String>

File glob patterns (e.g., [“src/**/.rs”, “tests/.rs”])

§config: Value

Plugin-specific configuration as JSON

§

DuplicateFunction

Duplicate a function with a new name

Fields

§target: MutationTargetSymbol

Target function (supports lazy resolution)

§to: String

New function name

§

DuplicateStruct

Duplicate a struct with a new name (including impl blocks)

Fields

§target: MutationTargetSymbol

Target struct (supports lazy resolution)

§to: String

New struct name

§include_impls: bool

Whether to also duplicate impl blocks

§

DuplicateEnum

Duplicate an enum with a new name (including impl blocks)

Fields

§target: MutationTargetSymbol

Target enum (supports lazy resolution)

§to: String

New enum name

§include_impls: bool

Whether to also duplicate impl blocks

§

DuplicateModTree

Duplicate an inline module with a new name

Fields

§target: MutationTargetSymbol

Target module (supports lazy resolution)

§to: String

New module name

Implementations§

Source§

impl MutationSpec

Source

pub fn kind_name(&self) -> &'static str

Get the kind name of this spec (e.g., “Rename”, “AddField”)

Used by MutationRegistry to route specs to appropriate converters. TODO: Consider typed approach (enum variant discriminant or macro-based)

Source

pub fn is_rename(&self) -> bool

Check if this mutation is a rename

Source

pub fn is_additive(&self) -> bool

Check if this is an additive operation (order-independent within same target)

Additive operations like AddItem, AddMethod, AddField etc. can be applied in any order to the same target without conflict, unless they add the same named item (detected via additive_identity).

Source

pub fn additive_identity(&self) -> Option<String>

Get unique identity for additive operations (for duplicate detection)

Returns a unique identifier for what this operation adds. Two additive operations with the same additive_identity targeting the same parent are true conflicts (trying to add the same thing twice).

Source

pub fn is_idiom(&self) -> bool

Check if this is an idiom transformation

Source

pub fn get_targets(&self) -> Vec<&MutationTargetSymbol>

Get target symbols from this spec.

Returns references to all MutationTargetSymbol fields in this spec. Used for computing affected_symbols after mutation execution.

Trait Implementations§

Source§

impl Clone for MutationSpec

Source§

fn clone(&self) -> MutationSpec

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 MutationSpec

Source§

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

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

impl<'de> Deserialize<'de> for MutationSpec

Source§

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

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

impl From<CascadeSpec> for MutationSpec

Source§

fn from(cascade: CascadeSpec) -> MutationSpec

Converts to this type from the input type.
Source§

impl PartialEq for MutationSpec

Source§

fn eq(&self, other: &MutationSpec) -> 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 Serialize for MutationSpec

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 MutationSpec

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

Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> 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> Same for T

Source§

type Output = T

Should always be Self
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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

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