Function kernel::registry::erased_user_handshake

source ·
unsafe fn erased_user_handshake<RD>(
    scheduler: &LocalScheduler,
    hello_bytes: &[u8],
    conn_tx: &ErasedKProducer,
    outptr: NonNull<()>,
) -> JoinHandle<Result<(), Error>>
Expand description

Perform a type-erased userspace handshake, deserializing the RegisteredDriver::Hello message from hello_bytes and returning a future that writes the handshake result to the provided outptr, if the future completes successfully.

§Safety

  • This function MUST be called with a RegisteredDriver type matching the type used to create the ErasedKProducer.
  • outptr MUST be a valid pointer to a mem::MaybeUninit<UserHandshakeResult<RD>>, and MUST live as long as the future returned from this function.
  • outptr is guaranteed to be initialized IF AND ONLY IF the future returned by this method returns Ok(()). If this method returns an Err, outptr will NOT be initialized.