Struct Flight

Source
pub struct Flight { /* private fields */ }

Implementations§

Source§

impl Flight

Source

pub fn frame_count(&self) -> u32

Returns the number of [frames] in this [flight].

Source

pub fn current_frame(&self) -> u64

Returns the current frame counter value. This always starts out at 0 and is monotonically increasing with each passing [frame].

Source

pub fn current_frame_index(&self) -> u32

Returns the index of the current [frame] in [flight].

Source

pub fn wait(&self, timeout: Option<Duration>) -> Result<(), VulkanError>

Waits for the oldest [frame] in [flight] to finish.

Source

pub fn wait_for_frame( &self, frame: u64, timeout: Option<Duration>, ) -> Result<(), VulkanError>

Waits for the given [frame] to finish. frame must have been previously obtained using current_frame on self.

§Panics
  • Panics if frame is greater than the current frame.
Source

pub fn destroy_object(&self, object: Arc<impl Any + Send + Sync>)

Queues the destruction of the given object after the destruction of the command buffer(s) for the previous [frame] in [flight].

§Panics
  • Panics if called from multiple threads at the same time.
  • Panics if the flight is currently being executed.
Source

pub fn destroy_objects( &self, objects: impl IntoIterator<Item = Arc<impl Any + Send + Sync>>, )

Queues the destruction of the given objects after the destruction of the command buffer(s) for the previous [frame] in [flight].

§Panics
  • Panics if called from multiple threads at the same time.
  • Panics if the flight is currently being executed.

Trait Implementations§

Source§

impl Debug for Flight

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Flight

§

impl !RefUnwindSafe for Flight

§

impl Send for Flight

§

impl Sync for Flight

§

impl Unpin for Flight

§

impl !UnwindSafe for Flight

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.