pub struct ProxyIndex { /* private fields */ }Expand description
An in-memory index of proxy entries keyed by original file path.
Implementations§
Source§impl ProxyIndex
impl ProxyIndex
Sourcepub fn insert(&mut self, entry: ProxyEntry)
pub fn insert(&mut self, entry: ProxyEntry)
Insert a ProxyEntry. Entries with the same original_path are accumulated.
Sourcepub fn find_by_original(&self, original_path: &str) -> &[ProxyEntry]
pub fn find_by_original(&self, original_path: &str) -> &[ProxyEntry]
Find all proxy entries for a given original path.
Sourcepub fn remove(&mut self, original_path: &str) -> Vec<ProxyEntry>
pub fn remove(&mut self, original_path: &str) -> Vec<ProxyEntry>
Remove all entries for a given original path. Returns the removed entries.
Sourcepub fn original_count(&self) -> usize
pub fn original_count(&self) -> usize
Return the number of unique originals in the index.
Sourcepub fn all_entries(&self) -> impl Iterator<Item = &ProxyEntry>
pub fn all_entries(&self) -> impl Iterator<Item = &ProxyEntry>
Return all entries as a flat iterator.
Sourcepub fn contains(&self, original_path: &str) -> bool
pub fn contains(&self, original_path: &str) -> bool
Return true if any proxy entry exists for the given original path.
Sourcepub fn best_quality(&self, original_path: &str) -> Option<&ProxyEntry>
pub fn best_quality(&self, original_path: &str) -> Option<&ProxyEntry>
Find the entry with the highest bitrate for a given original path.
Trait Implementations§
Source§impl Debug for ProxyIndex
impl Debug for ProxyIndex
Source§impl Default for ProxyIndex
impl Default for ProxyIndex
Source§fn default() -> ProxyIndex
fn default() -> ProxyIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProxyIndex
impl RefUnwindSafe for ProxyIndex
impl Send for ProxyIndex
impl Sync for ProxyIndex
impl Unpin for ProxyIndex
impl UnsafeUnpin for ProxyIndex
impl UnwindSafe for ProxyIndex
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> 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