pub struct DriverRegistry { /* private fields */ }Expand description
Registry of file format drivers, dispatching by file extension.
Implementations§
Source§impl DriverRegistry
impl DriverRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, driver: Box<dyn SutureDriver>)
pub fn register(&mut self, driver: Box<dyn SutureDriver>)
Register a driver for its supported extensions.
Sourcepub fn get_for_path(
&self,
path: &Path,
) -> Result<&dyn SutureDriver, DriverError>
pub fn get_for_path( &self, path: &Path, ) -> Result<&dyn SutureDriver, DriverError>
Get a driver for the given file path (by extension).
Sourcepub fn get(&self, extension: &str) -> Result<&dyn SutureDriver, DriverError>
pub fn get(&self, extension: &str) -> Result<&dyn SutureDriver, DriverError>
Get a driver for a specific extension string (e.g., “.json”).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DriverRegistry
impl !RefUnwindSafe for DriverRegistry
impl Send for DriverRegistry
impl Sync for DriverRegistry
impl Unpin for DriverRegistry
impl UnsafeUnpin for DriverRegistry
impl !UnwindSafe for DriverRegistry
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