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.
pub fn iter(&self) -> impl Iterator<Item = (&Moniker, &InstanceId)>
Trait Implementations§
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§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more