pub struct ProxyLinkRegistry {
pub links: Vec<ProxyLink>,
}Expand description
In-memory registry that maps proxy files to their originals.
Fields§
§links: Vec<ProxyLink>All registered links.
Implementations§
Source§impl ProxyLinkRegistry
impl ProxyLinkRegistry
Sourcepub fn register(&mut self, proxy: &str, original: &str, checksum: u64)
pub fn register(&mut self, proxy: &str, original: &str, checksum: u64)
Register a proxy↔original association.
If a link for the same proxy path already exists it is replaced.
Sourcepub fn find_original(&self, proxy: &str) -> Option<&str>
pub fn find_original(&self, proxy: &str) -> Option<&str>
Find the original path for a given proxy path.
Returns None if no link exists for the given proxy.
Sourcepub fn find_proxy(&self, original: &str) -> Option<&str>
pub fn find_proxy(&self, original: &str) -> Option<&str>
Find the proxy path for a given original path.
Returns None if the original is not linked to any proxy.
Trait Implementations§
Source§impl Debug for ProxyLinkRegistry
impl Debug for ProxyLinkRegistry
Source§impl Default for ProxyLinkRegistry
impl Default for ProxyLinkRegistry
Source§fn default() -> ProxyLinkRegistry
fn default() -> ProxyLinkRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProxyLinkRegistry
impl RefUnwindSafe for ProxyLinkRegistry
impl Send for ProxyLinkRegistry
impl Sync for ProxyLinkRegistry
impl Unpin for ProxyLinkRegistry
impl UnsafeUnpin for ProxyLinkRegistry
impl UnwindSafe for ProxyLinkRegistry
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