pub struct Index { /* private fields */ }
Expand description
An index that maps component monikers to instance IDs.
Unlike [PersistedIndex], this type is validated to only contain unique instance IDs.
Implementations§
Source§impl Index
impl Index
Sourcepub fn from_fidl_file(path: &Utf8Path) -> Result<Self, IndexError>
pub fn from_fidl_file(path: &Utf8Path) -> Result<Self, IndexError>
Return an Index parsed from the FIDL file at path
.
Sourcepub fn insert(
&mut self,
moniker: Moniker,
instance_id: InstanceId,
) -> Result<(), ValidationError>
pub fn insert( &mut self, moniker: Moniker, instance_id: InstanceId, ) -> Result<(), ValidationError>
Insert an entry into the index.
Sourcepub fn id_for_moniker(&self, moniker: &Moniker) -> Option<&InstanceId>
pub fn id_for_moniker(&self, moniker: &Moniker) -> Option<&InstanceId>
Returns the instance ID for the moniker, if the index contains the moniker.
Sourcepub fn contains_id(&self, id: &InstanceId) -> bool
pub fn contains_id(&self, id: &InstanceId) -> bool
Returns true if the index contains the instance ID.
Trait Implementations§
Source§impl From<Index> for ComponentIdIndex
impl From<Index> for ComponentIdIndex
Source§impl TryFrom<ComponentIdIndex> for Index
impl TryFrom<ComponentIdIndex> for Index
Source§type Error = FidlConversionError
type Error = FidlConversionError
The type returned in the event of a conversion error.
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)