pub struct InterfaceLock {
pub next: u32,
pub entries: Vec<LockEntry>,
}Expand description
The parsed table.
Fields§
§next: u32The next number to allocate; greater than every entry’s number.
entries: Vec<LockEntry>Every entry, live and retired, in file order. render
sorts them by number.
Implementations§
Source§impl InterfaceLock
impl InterfaceLock
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
The file text: the header, next N, then every entry in number order,
one \n after each line.
Sourcepub fn live(&self, key: &LockKey) -> Option<&LockEntry>
pub fn live(&self, key: &LockKey) -> Option<&LockEntry>
The live entry holding key, if any. A retired entry never matches.
Sourcepub fn max_number(&self) -> u32
pub fn max_number(&self) -> u32
The highest number in the table, retired entries included; 0 when there is none.
Sourcepub fn allocate(&mut self, key: LockKey) -> Result<u32, LockEditError>
pub fn allocate(&mut self, key: LockKey) -> Result<u32, LockEditError>
Allocates next to a new live entry for key and raises next by
one. A retired entry with the same key does not stand in the way: the
old name is free for a later, unrelated interface (lock design §4).
Trait Implementations§
Source§impl Clone for InterfaceLock
impl Clone for InterfaceLock
Source§impl Debug for InterfaceLock
impl Debug for InterfaceLock
Source§impl Default for InterfaceLock
impl Default for InterfaceLock
impl Eq for InterfaceLock
Source§impl Hash for InterfaceLock
impl Hash for InterfaceLock
Source§impl PartialEq for InterfaceLock
impl PartialEq for InterfaceLock
impl StructuralPartialEq for InterfaceLock
Auto Trait Implementations§
impl Freeze for InterfaceLock
impl RefUnwindSafe for InterfaceLock
impl Send for InterfaceLock
impl Sync for InterfaceLock
impl Unpin for InterfaceLock
impl UnsafeUnpin for InterfaceLock
impl UnwindSafe for InterfaceLock
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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