Struct rp2040_hal::multicore::Core
source · pub struct Core<'p> { /* private fields */ }
Expand description
A handle for controlling a logical core.
Implementations§
source§impl<'p> Core<'p>
impl<'p> Core<'p>
sourcepub fn spawn<F>(
&mut self,
stack: &'static mut [usize],
entry: F
) -> Result<(), Error>
pub fn spawn<F>( &mut self, stack: &'static mut [usize], entry: F ) -> Result<(), Error>
Spawn a function on this core.
The closure should not return. It is currently defined as -> ()
because -> !
is not yet
stable.
Core 1 will be reset from core 0 in order to spawn another task.
Resetting a single core of a running program can have undesired consequences. Deadlocks are likely if the core being reset happens to be inside a critical section. It may even break safety assumptions of some unsafe code. So, be careful when calling this method more than once.
Auto Trait Implementations§
impl<'p> Freeze for Core<'p>
impl<'p> RefUnwindSafe for Core<'p>
impl<'p> Send for Core<'p>
impl<'p> !Sync for Core<'p>
impl<'p> Unpin for Core<'p>
impl<'p> !UnwindSafe for Core<'p>
Blanket Implementations§
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
source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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