pub struct HResult(pub i32);Expand description
BMD HRESULT code, surfaced to callbacks. is_ok() iff >= 0 per
standard COM convention.
Tuple Fields§
§0: i32Implementations§
Source§impl HResult
impl HResult
pub const S_OK: HResult
Sourcepub fn is_err(self) -> bool
pub fn is_err(self) -> bool
Examples found in repository?
examples/to_rgba_pipelined.rs (line 58)
57 fn on_read_complete(&self, slot: u64, result: HResult, frame: Option<Frame>) {
58 if result.is_err() {
59 return self.fail(slot, format!("read failed: {result}"));
60 }
61 let Some(mut frame) = frame else {
62 return self.fail(slot, "read returned no frame");
63 };
64 if let Err(e) = frame.set_resource_format(self.format) {
65 return self.fail(slot, format!("SetResourceFormat: {e}"));
66 }
67 if let Err(e) = frame.set_resolution_scale(self.scale) {
68 return self.fail(slot, format!("SetResolutionScale: {e}"));
69 }
70 let mut job = match frame.create_decode_and_process_job() {
71 Ok(j) => j,
72 Err(e) => return self.fail(slot, format!("CreateJobDecodeAndProcessFrame: {e}")),
73 };
74 if let Err(e) = job.set_user_data(slot) {
75 return self.fail(slot, format!("SetUserData: {e}"));
76 }
77 if let Err(e) = job.submit() {
78 return self.fail(slot, format!("decode+process Submit: {e}"));
79 }
80 }Trait Implementations§
impl Copy for HResult
impl Eq for HResult
impl StructuralPartialEq for HResult
Auto Trait Implementations§
impl Freeze for HResult
impl RefUnwindSafe for HResult
impl Send for HResult
impl Sync for HResult
impl Unpin for HResult
impl UnsafeUnpin for HResult
impl UnwindSafe for HResult
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