rendy_chain

Struct Link

Source
pub struct Link<R: Resource> { /* private fields */ }
Expand description

This type defines what states resource are at some point in time when commands recorded into corresponding submissions are executed. Those commands doesn’t required to perform actions with all access types declared by the link. But performing actions with access types not declared by the link is prohibited.

Implementations§

Source§

impl<R> Link<R>
where R: Resource,

Source

pub fn new(node: LinkNode<R>) -> Self

Create new link with first attached submission.

§Parameters

access - Access flags performed in submission. usage - Usage flags required by submission.

Source

pub fn family(&self) -> QueueFamilyId

Get queue family that owns the resource at the link. All associated submissions must be from the same queue family.

Source

pub fn submission_state(&self, sid: SubmissionId) -> State<R>

Get usage.

Source

pub fn state(&self) -> State<R>

Get usage.

Source

pub fn access(&self) -> R::Access

Get access.

Source

pub fn layout(&self) -> R::Layout

Get layout.

Source

pub fn usage(&self) -> R::Usage

Get usage.

Source

pub fn single_queue(&self) -> bool

Check if the link is associated with only one queue.

Source

pub fn compatible(&self, node: &LinkNode<R>) -> bool

Check if the given state and submission are compatible with link. If compatible then the submission can be associated with the link.

Source

pub fn add_node(&mut self, node: LinkNode<R>)

Insert submission with specified state to the link. It must be compatible. Associating submission with the link will allow the submission to be executed in parallel with other submissions associated with this link. Unless other chains disallow.

§Panics

This function will panic if state and sid are not compatible. E.g. Link::compatible didn’t return true for the arguments.

Source

pub fn queues(&self) -> impl Iterator<Item = (QueueId, &LinkQueueState<R>)>

Iterate over queues.

Source

pub fn queue(&self, qid: QueueId) -> &LinkQueueState<R>

Get particular queue

Trait Implementations§

Source§

impl<R: Clone + Resource> Clone for Link<R>
where R::Access: Clone, R::Usage: Clone, R::Layout: Clone,

Source§

fn clone(&self) -> Link<R>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug + Resource> Debug for Link<R>
where R::Access: Debug, R::Usage: Debug, R::Layout: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Freeze for Link<R>
where <R as Resource>::Access: Freeze, <R as Resource>::Usage: Freeze, <R as Resource>::Layout: Freeze,

§

impl<R> RefUnwindSafe for Link<R>

§

impl<R> Send for Link<R>
where <R as Resource>::Access: Send, <R as Resource>::Usage: Send, <R as Resource>::Layout: Send,

§

impl<R> Sync for Link<R>
where <R as Resource>::Access: Sync, <R as Resource>::Usage: Sync, <R as Resource>::Layout: Sync,

§

impl<R> Unpin for Link<R>
where <R as Resource>::Access: Unpin, <R as Resource>::Usage: Unpin, <R as Resource>::Layout: Unpin,

§

impl<R> UnwindSafe for Link<R>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.