fidl_fuchsia_ui_views_ext/
lib.rsuse fidl_fuchsia_ui_views::ViewRef;
use zx::{self as zx, AsHandleRef};
pub trait ViewRefExt {
fn get_koid(&self) -> Result<zx::Koid, zx::Status>;
}
impl ViewRefExt for ViewRef {
fn get_koid(&self) -> Result<zx::Koid, zx::Status> {
self.reference.as_handle_ref().get_koid()
}
}
#[cfg(test)]
mod tests {
use super::*;
use fuchsia_scenic::ViewRefPair;
#[test]
fn smoke_test_get_koid() {
let ViewRefPair { control_ref: _control_ref, view_ref } =
ViewRefPair::new().expect("making ViewRefPair");
assert!(view_ref.get_koid().is_ok());
}
}