Struct target_features::Target

source ·
pub struct Target { /* private fields */ }
Expand description

A target architecture with optional features.

Implementations§

Returns a suggested number of elements for a SIMD vector of the provided type.

The returned value is an approximation and not necessarily indicative of the optimal vector width. A few caveats:

  • Every instruction set is different, and this function doesn’t take into account any particular operations–it’s just a guess, and should be accurate at least for basic arithmetic.
  • Variable length vector instruction sets (ARM SVE and RISC-V V) only return the minimum vector length.

Create a target with no specified features.

Create a target based on a particular CPU.

Returns the target architecture.

Returns an iterator over the features.

Returns whether the target supports the specified feature.

Returns whether the target supports the specified feature.

Panics

Panics if the feature doesn’t belong to the target architecture.

Add a feature to the target.

Panics

Panics if the feature doesn’t belong to the target architecture.

Add a feature to the target.

Panics

Panics if the requested feature name doesn’t exist for the target architecture.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.