Struct FileToIdConverter
pub struct FileToIdConverter { /* private fields */ }Expand description
Maps data/<namespace>/<directory>/<path><extension> to namespace:path,
preserving subdirectories. Any namespace may add entries for a listener.
The same converter can be used for client assets.
Implementations§
§impl FileToIdConverter
impl FileToIdConverter
pub fn new(
directory: &str,
extension: &str,
) -> Result<FileToIdConverter, FileToIdConverterError>
pub fn new( directory: &str, extension: &str, ) -> Result<FileToIdConverter, FileToIdConverterError>
A relative directory without trailing /, and a suffix such as .json.
An empty extension keeps each relative resource path whole.
pub fn json(
directory: &str,
) -> Result<FileToIdConverter, FileToIdConverterError>
pub fn json( directory: &str, ) -> Result<FileToIdConverter, FileToIdConverterError>
Vanilla’s FileToIdConverter.json(directory).
Trait Implementations§
§impl TryFrom<(String, String)> for FileToIdConverter
A converter from its directory and extension, checked as FileToIdConverter::new checks
them.
impl TryFrom<(String, String)> for FileToIdConverter
A converter from its directory and extension, checked as FileToIdConverter::new checks
them.
§type Error = FileToIdConverterError
type Error = FileToIdConverterError
The type returned in the event of a conversion error.
§impl Wire for FileToIdConverter
impl Wire for FileToIdConverter
Auto Trait Implementations§
impl Freeze for FileToIdConverter
impl RefUnwindSafe for FileToIdConverter
impl Send for FileToIdConverter
impl Sync for FileToIdConverter
impl Unpin for FileToIdConverter
impl UnsafeUnpin for FileToIdConverter
impl UnwindSafe for FileToIdConverter
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