pub struct CommandStreamDraft<A = ()> {
pub args: A,
/* private fields */
}Expand description
A finalized command stream definition that can be prepared later.
Drafts are useful when construction should happen separately from preparation. Convert a draft
with CommandStreamDraft::into_stream for unprepared insertion or
CommandStreamDraft::prepare to cache preparation work.
let draft = CommandStream::finalize(|stream| {
stream.begin_cmd().record_cmd(|_| {});
});
let prepared = draft.prepare(&mut pool)?;
let mut graph = Graph::new();
graph.insert_cmd_stream(&prepared).finish();Fields§
§args: ATyped handles returned by the finalization callback.
Implementations§
Source§impl<A> CommandStreamDraft<A>
impl<A> CommandStreamDraft<A>
Sourcepub fn into_stream(self) -> CommandStream<A>
pub fn into_stream(self) -> CommandStream<A>
Converts this draft into a command stream without preparing optimizations.
Unprepared streams avoid preparation cost until insertion, but they do not cache the prepared schedule or static recording resources.
Sourcepub fn prepare<P>(self, pool: &mut P) -> Result<CommandStream<A>, DriverError>where
P: SubmissionPool,
pub fn prepare<P>(self, pool: &mut P) -> Result<CommandStream<A>, DriverError>where
P: SubmissionPool,
Prepares this stream by optimizing its finalized graph and leasing static recording resources for the prepared schedule.
This is most useful when the same stream is inserted many times with different arguments.
Trait Implementations§
Auto Trait Implementations§
impl<A = ()> !Freeze for CommandStreamDraft<A>
impl<A> RefUnwindSafe for CommandStreamDraft<A>where
A: RefUnwindSafe,
impl<A> Send for CommandStreamDraft<A>where
A: Send,
impl<A> Sync for CommandStreamDraft<A>where
A: Sync,
impl<A> Unpin for CommandStreamDraft<A>where
A: Unpin,
impl<A> UnsafeUnpin for CommandStreamDraft<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for CommandStreamDraft<A>where
A: 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
Mutably borrows from an owned value. Read more