Struct basalt::Basalt

source ·
pub struct Basalt { /* private fields */ }
Expand description

The main object of this crate.

§Notes

  • This is expected to be kept alive for the lifetime of the application.
  • There should only ever be one instance of this struct.

Implementations§

source§

impl Basalt

source

pub fn initialize<F: FnMut(Result<Arc<Self>, String>) + Send + 'static>( options: BasaltOptions, result_fn: F )

Begin initializing Basalt, this thread will be taken for window event polling and the function provided in result_fn will be executed after Basalt initialization has completed or errored.

source

pub fn input_ref(&self) -> &Input

Obtain a reference of Input

source

pub fn interval(&self) -> Arc<Interval>

Obtain a copy of Arc<Interval>

source

pub fn interval_ref(&self) -> &Arc<Interval>

Obtain a reference of Arc<Interval>

source

pub fn interface(&self) -> Arc<Interface>

Obtain a copy of Arc<Interface>

source

pub fn interface_ref(&self) -> &Arc<Interface>

Obtain a reference of Arc<Interface>

source

pub fn image_cache(&self) -> Arc<ImageCache>

Obtain a copy of Arc<ImageCache>

source

pub fn image_cache_ref(&self) -> &Arc<ImageCache>

Obtain a refernce of Arc<ImageCache>

source

pub fn window_manager(&self) -> Arc<WindowManager>

Obtain a copy of Arc<WindowManager>

source

pub fn window_manager_ref(&self) -> &Arc<WindowManager>

Obtain a reference of Arc<WindowManager>

source

pub fn instance(&self) -> Arc<Instance>

Obtain a copy of Arc<Instance>

source

pub fn instance_ref(&self) -> &Arc<Instance>

Obtain a reference of Arc<Instance>

source

pub fn physical_device(&self) -> Arc<PhysicalDevice>

Obtain a copy of Arc<PhysicalDevice>

source

pub fn physical_device_ref(&self) -> &Arc<PhysicalDevice>

Obtain a reference of Arc<PhysicalDevice>

source

pub fn device(&self) -> Arc<Device>

Obtain a copy of Arc<Devcie>

source

pub fn device_ref(&self) -> &Arc<Device>

Obtain a refernce of Arc<Device>

source

pub fn graphics_queue(&self) -> Arc<Queue>

Obtain a copy of the Arc<Queue> assigned for graphics operations.

source

pub fn graphics_queue_ref(&self) -> &Arc<Queue>

Obtain a reference of the Arc<Queue> assigned for graphics operations.

source

pub fn secondary_graphics_queue(&self) -> Option<Arc<Queue>>

Obtain a copy of the Arc<Queue> assigned for secondary graphics operations.

source

pub fn secondary_graphics_queue_ref(&self) -> Option<&Arc<Queue>>

Obtain a reference of the Arc<Queue> assigned for secondary graphics operations.

source

pub fn compute_queue(&self) -> Arc<Queue>

Obtain a copy of the Arc<Queue> assigned for compute operations.

§Notes:
  • This queue may be the same as the graphics queue in cases where the device only has a single queue present.
source

pub fn compute_queue_ref(&self) -> &Arc<Queue>

Obtain a reference of the Arc<Queue> assigned for compute operations.

§Notes:
  • This queue may be the same as the graphics queue in cases where the device only has a single queue present.
source

pub fn secondary_compute_queue(&self) -> Option<Arc<Queue>>

Obtain a copy of the Arc<Queue> assigned for secondary compute operations.

source

pub fn secondary_compute_queue_ref(&self) -> Option<&Arc<Queue>>

Obtain a reference of the Arc<Queue> assigned for secondary compute operations.

source

pub fn transfer_queue(&self) -> Arc<Queue>

Obtain a copy of the Arc<Queue> assigned for transfers.

§Notes:
  • This queue may be the same as the compute queue in cases where the device only has two queues present. In cases where there is only one queue the graphics, compute, and transfer queues will all be the same queue.
source

pub fn transfer_queue_ref(&self) -> &Arc<Queue>

Obtain a reference of the Arc<Queue> assigned for transfers.

§Notes:
  • This queue may be the same as the compute queue in cases where the device only has two queues present. In cases where there is only one queue the graphics, compute, and transfer queues will all be the same queue.
source

pub fn secondary_transfer_queue(&self) -> Option<Arc<Queue>>

Obtain a copy of the Arc<Queue> assigned for secondary transfers.

source

pub fn secondary_transfer_queue_ref(&self) -> Option<&Arc<Queue>>

Obtain a reference of the Arc<Queue> assigned for secondary transfers.

source

pub fn exit(&self)

Signal the application to exit.

source

pub fn wants_exit(&self) -> bool

Check if basalt is attempting to exit.

Trait Implementations§

source§

impl Debug for Basalt

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Basalt

§

impl !RefUnwindSafe for Basalt

§

impl Send for Basalt

§

impl Sync for Basalt

§

impl Unpin for Basalt

§

impl !UnwindSafe for Basalt

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> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more