YCQueueSharedData

Struct YCQueueSharedData 

Source
pub struct YCQueueSharedData<'a> {
    pub meta: YCQueueSharedMeta<'a>,
    pub data: &'a mut [u8],
}

Fields§

§meta: YCQueueSharedMeta<'a>§data: &'a mut [u8]

Implementations§

Source§

impl<'a> YCQueueSharedData<'a>

Create a YC queue view from non-owned data. Since This relies on referencing memory we do not own but need to mutably borrow (the queue slots) that is shared with other threads that will be also mutably borrowing the same slices (though not at the same time), we allow data access through unsafe. It’s not clear to me if this can be safe, for inter-process comms you would need to map this memory with unsafe too since it could “change underneath you”. (of course, gated by the atomics and proper memory barriers, since that is the point of this library.)

Trait Implementations§

Source§

impl<'a> Debug for YCQueueSharedData<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for YCQueueSharedData<'a>

§

impl<'a> RefUnwindSafe for YCQueueSharedData<'a>

§

impl<'a> Send for YCQueueSharedData<'a>

§

impl<'a> Sync for YCQueueSharedData<'a>

§

impl<'a> Unpin for YCQueueSharedData<'a>

§

impl<'a> !UnwindSafe for YCQueueSharedData<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.