driver_manager_types/
bind_result.rs1use fidl_fuchsia_driver_framework as fdf;
6
7#[derive(Debug)]
8pub enum BindResult {
9 NotBound,
10 Driver(String),
11 Composite(Vec<fdf::CompositeParent>),
12}
13
14impl BindResult {
15 pub fn is_bound(&self) -> bool {
16 !matches!(self, BindResult::NotBound)
17 }
18
19 pub fn driver_url(&self) -> Option<&str> {
20 if let BindResult::Driver(url) = self { Some(url) } else { None }
21 }
22
23 pub fn composite_parents(&self) -> Option<&[fdf::CompositeParent]> {
24 if let BindResult::Composite(parents) = self { Some(parents) } else { None }
25 }
26}