Struct erupt::utils::VulkanResult
source · [−]Expand description
Idiomatic wrapper around a Vulkan Result.
Fields
raw: Result
The raw result from Vulkan.
value: Option<T>
The value this wrapper type may be holding.
Implementations
Construct a new VulkanResult
from raw
and value
.
This will not populate self.value
if the raw result is negative (Error).
Returns the contained value, consuming self
.
Panics with the name of self.raw
if self.value
is None
.
Returns the contained value, consuming self
.
Panics with msg
and the name of self.raw
if self.value
is None
.
Converts from &VulkanResult<T>
to VulkanResult<&T>
.
Clones self.raw
.
Converts from &mut VulkanResult<T>
to VulkanResult<&mut T>
.
Clones self.raw
.
Constructs a new VulkanResult
from value
.
This will always set self.raw
to vk::Result::SUCCESS
.
Constructs a new VulkanResult
from raw
.
This will always set self.value
to None
.
Maps Some(v)
of self.value
to Ok(v)
and None
of self.value
to Err(self.raw)
.
Maps Some(v)
of self.value
to Ok(v)
and None
of self.value
to Err(op(self.raw))
.
Returns true
if self.raw
is negative.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for VulkanResult<T> where
T: RefUnwindSafe,
impl<T> Send for VulkanResult<T> where
T: Send,
impl<T> Sync for VulkanResult<T> where
T: Sync,
impl<T> Unpin for VulkanResult<T> where
T: Unpin,
impl<T> UnwindSafe for VulkanResult<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more