pub struct Candidate<F> { /* private fields */ }Expand description
A kernel together with the CPU features it needs.
Construct one with target_kernel!, which derives
the features from the kernel’s own #[target_feature] list.
Implementations§
Source§impl<F: Copy> Candidate<F>
impl<F: Copy> Candidate<F>
Sourcepub const unsafe fn new(
name: &'static str,
features: CpuFeatures,
kernel: F,
) -> Self
pub const unsafe fn new( name: &'static str, features: CpuFeatures, kernel: F, ) -> Self
A candidate named name that runs kernel on hosts with features.
Prefer target_kernel!, which derives
features from the kernel’s #[target_feature] list.
§Safety
Calling kernel must be sound on every host that supports features.
Sourcepub const fn features(&self) -> CpuFeatures
pub const fn features(&self) -> CpuFeatures
Features the host needs to run this kernel.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Candidate<F>where
F: Freeze,
impl<F> RefUnwindSafe for Candidate<F>where
F: RefUnwindSafe,
impl<F> Send for Candidate<F>where
F: Send,
impl<F> Sync for Candidate<F>where
F: Sync,
impl<F> Unpin for Candidate<F>where
F: Unpin,
impl<F> UnsafeUnpin for Candidate<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Candidate<F>where
F: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more