pub struct MediaRoot { /* private fields */ }Expand description
An ordered filesystem or URI boundary searched by the resolver.
Implementations§
Source§impl MediaRoot
impl MediaRoot
Sourcepub fn validate_name(name: &str) -> Result<()>
pub fn validate_name(name: &str) -> Result<()>
Validates a production-portable logical root name.
§Errors
Returns ErrorKind::InvalidArgument when name is empty, oversized,
path-shaped, contains control characters, or has surrounding whitespace.
Sourcepub fn new(
id: MediaRootId,
name: impl Into<String>,
label: Option<String>,
legacy_uri: Option<String>,
priority: i32,
enabled: bool,
) -> Result<Self>
pub fn new( id: MediaRootId, name: impl Into<String>, label: Option<String>, legacy_uri: Option<String>, priority: i32, enabled: bool, ) -> Result<Self>
Creates a configured logical media root.
§Errors
Returns ErrorKind::InvalidArgument when name is not a bounded,
portable root name or when legacy_uri is invalid or relative.
Sourcepub const fn id(&self) -> MediaRootId
pub const fn id(&self) -> MediaRootId
Returns the root’s stable identity.
Sourcepub fn legacy_uri(&self) -> Option<&str>
pub fn legacy_uri(&self) -> Option<&str>
Returns the absolute URI retained while migrating a pre-version-6 root.
New roots do not carry this machine-local fallback.
Sourcepub const fn priority(&self) -> i32
pub const fn priority(&self) -> i32
Returns the resolver priority; lower values are considered first.
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Returns whether this root participates in resolution.
Trait Implementations§
impl Eq for MediaRoot
impl StructuralPartialEq for MediaRoot
Auto Trait Implementations§
impl Freeze for MediaRoot
impl RefUnwindSafe for MediaRoot
impl Send for MediaRoot
impl Sync for MediaRoot
impl Unpin for MediaRoot
impl UnsafeUnpin for MediaRoot
impl UnwindSafe for MediaRoot
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