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,
impl<R> Link<R>where
R: Resource,
Sourcepub fn new(node: LinkNode<R>) -> Self
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.
Sourcepub fn family(&self) -> QueueFamilyId
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.
Sourcepub fn submission_state(&self, sid: SubmissionId) -> State<R>
pub fn submission_state(&self, sid: SubmissionId) -> State<R>
Get usage.
Sourcepub fn single_queue(&self) -> bool
pub fn single_queue(&self) -> bool
Check if the link is associated with only one queue.
Sourcepub fn compatible(&self, node: &LinkNode<R>) -> bool
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.
Sourcepub fn add_node(&mut self, node: LinkNode<R>)
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.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Link<R>
impl<R> RefUnwindSafe for Link<R>where
<R as Resource>::Access: RefUnwindSafe,
<R as Resource>::Usage: RefUnwindSafe,
<R as Resource>::Layout: RefUnwindSafe,
impl<R> Send for Link<R>
impl<R> Sync for Link<R>
impl<R> Unpin for Link<R>
impl<R> UnwindSafe for Link<R>where
<R as Resource>::Access: UnwindSafe,
<R as Resource>::Usage: UnwindSafe,
<R as Resource>::Layout: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)