Struct pasture_io::base::IOFactory [−][src]
Factory that can create PointReader
and PointWriter
objects based on file extensions. Use this if you have a file path
and just want to create a PointReader
or PointWriter
from this path, without knowing the type of file. The Default
implementation supports all file formats that Pasture natively works with, custom formats can be registered using the
register_...
functions
Implementations
impl IOFactory
[src]
pub fn make_reader(&self, file: &Path) -> Result<Box<dyn PointReadAndSeek>>
[src]
Try to create a PointReader
that can read from the given file
. This function will fail if file
has
a format that is unsupported by Pasture, or if there are any I/O errors while trying to access file
.
pub fn make_writer(&self, file: &Path) -> Result<Box<dyn PointWriter>>
[src]
Try to create a PointWriter
for writing into the given file
. This function will fail if file
has
a format that is unsupported by Pasture, or if there are any I/O errors while trying to access file
.
pub fn supports_reading_from(&self, extension: &'static str) -> bool
[src]
Returns true
if the associated IOFactory
supports creating PointReader
objects for the given
file extension
pub fn supports_writing_to(&self, extension: &'static str) -> bool
[src]
Returns true
if the associated IOFactory
supports creating PointWriter
objects for the given
file extension
pub fn register_reader_for_extension<F: Fn(&Path) -> Result<Box<dyn PointReadAndSeek>> + 'static>(
&mut self,
extension: &'static str,
reader_factory: F
) -> Option<Box<dyn Fn(&Path) -> Result<Box<dyn PointReadAndSeek>>>>
[src]
&mut self,
extension: &'static str,
reader_factory: F
) -> Option<Box<dyn Fn(&Path) -> Result<Box<dyn PointReadAndSeek>>>>
Register a new readable file extension with the associated IOFactory
. The reader_factory
will be called whenever
extension
is encountered as a file extension in make_reader
. Returns the previous reader factory function that
was registered for extension
, if there was any.
pub fn register_writer_for_extension<F: Fn(&Path) -> Result<Box<dyn PointWriter>> + 'static>(
&mut self,
extension: &'static str,
writer_factory: F
) -> Option<Box<dyn Fn(&Path) -> Result<Box<dyn PointWriter>>>>
[src]
&mut self,
extension: &'static str,
writer_factory: F
) -> Option<Box<dyn Fn(&Path) -> Result<Box<dyn PointWriter>>>>
Register a new writeable file extension with the associated IOFactory
. The writer_factory
will be called whenever
extension
is encountered as a file extension in make_writer
. Returns the previous writer factory function that
was registered for extension
, if there was any.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for IOFactory
impl !Send for IOFactory
impl !Sync for IOFactory
impl Unpin for IOFactory
impl !UnwindSafe for IOFactory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,