pub unsafe trait Request: Send + 'static {
type Raw: Copy + Send + Sized + 'static;
const ID: RequestId;
// Required methods
fn len(&self) -> usize;
unsafe fn from_ptr<'a>(
ptr: *const u8,
dbr: RequestId,
count: usize,
) -> Result<&'a Self, Error>;
fn clone_boxed(&self) -> Box<Self>;
}Expand description
Abstract request to channel.
§Safety
Should be implemented only for requests supported by channel access.
Self and Self::Raw must be safely transmutable to each other.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourceunsafe fn from_ptr<'a>(
ptr: *const u8,
dbr: RequestId,
count: usize,
) -> Result<&'a Self, Error>
unsafe fn from_ptr<'a>( ptr: *const u8, dbr: RequestId, count: usize, ) -> Result<&'a Self, Error>
Create reference (possibly wide) to the request from raw pointer and count of elements.
§Safety
Pointer must be valid and point to raw request structure.
Sourcefn clone_boxed(&self) -> Box<Self>
fn clone_boxed(&self) -> Box<Self>
Clone request and put it in newly allocated box.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.