pub struct ProxyManagerSpec { /* private fields */ }Expand description
Manages proxy metadata records indexed by original clip path.
This type coexists with the legacy proxy::ProxyManager which manages
crate::proxy::ProxyLink records. ProxyManagerSpec is the newer,
spec-driven variant.
Implementations§
Source§impl ProxyManagerSpec
impl ProxyManagerSpec
Sourcepub fn register(
&mut self,
meta: ProxyMetadata,
) -> Result<(), ProxyValidationError>
pub fn register( &mut self, meta: ProxyMetadata, ) -> Result<(), ProxyValidationError>
Register a proxy metadata record.
§Errors
Returns ProxyValidationError::EmptyPath if either path is empty.
Sourcepub fn find_proxy(&self, original_path: &str) -> Option<&ProxyMetadata>
pub fn find_proxy(&self, original_path: &str) -> Option<&ProxyMetadata>
Look up the proxy record for original_path.
Sourcepub fn is_proxy_valid(
&self,
original_path: &str,
actual_width: u32,
actual_height: u32,
) -> Result<bool, ProxyValidationError>
pub fn is_proxy_valid( &self, original_path: &str, actual_width: u32, actual_height: u32, ) -> Result<bool, ProxyValidationError>
Check whether the proxy dimensions match the recorded spec.
Returns Ok(true) when valid, Ok(false) when dimensions mismatch,
and Err(ProxyValidationError::NotRegistered) when no record exists.
§Errors
Returns ProxyValidationError::NotRegistered if no proxy is
registered for original_path.
Sourcepub fn remove(&mut self, original_path: &str) -> Option<ProxyMetadata>
pub fn remove(&mut self, original_path: &str) -> Option<ProxyMetadata>
Remove and return the proxy record for original_path.
Sourcepub fn list_all(&self) -> Vec<&ProxyMetadata>
pub fn list_all(&self) -> Vec<&ProxyMetadata>
Return references to all registered proxy records.
Trait Implementations§
Source§impl Clone for ProxyManagerSpec
impl Clone for ProxyManagerSpec
Source§fn clone(&self) -> ProxyManagerSpec
fn clone(&self) -> ProxyManagerSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProxyManagerSpec
impl Debug for ProxyManagerSpec
Source§impl Default for ProxyManagerSpec
impl Default for ProxyManagerSpec
Source§fn default() -> ProxyManagerSpec
fn default() -> ProxyManagerSpec
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProxyManagerSpec
impl RefUnwindSafe for ProxyManagerSpec
impl Send for ProxyManagerSpec
impl Sync for ProxyManagerSpec
impl Unpin for ProxyManagerSpec
impl UnsafeUnpin for ProxyManagerSpec
impl UnwindSafe for ProxyManagerSpec
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> 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