pub struct DataTypePlugin(/* private fields */);Expand description
A data type plugin.
Implementations§
Source§impl DataTypePlugin
impl DataTypePlugin
Sourcepub const fn new(
identifier: &'static str,
match_name_fn: fn(name: &str, version: ZarrVersions) -> bool,
default_name_fn: fn(ZarrVersions) -> Cow<'static, str>,
create_fn: fn(metadata: &MetadataV3) -> Result<DataType, PluginCreateError>,
) -> Self
pub const fn new( identifier: &'static str, match_name_fn: fn(name: &str, version: ZarrVersions) -> bool, default_name_fn: fn(ZarrVersions) -> Cow<'static, str>, create_fn: fn(metadata: &MetadataV3) -> Result<DataType, PluginCreateError>, ) -> Self
Create a new DataTypePlugin.
Methods from Deref<Target = Plugin<DataType, MetadataV3>>§
Sourcepub fn create(&self, input: &TInput) -> Result<TPlugin, PluginCreateError>
pub fn create(&self, input: &TInput) -> Result<TPlugin, PluginCreateError>
Create a TPlugin plugin from inputs.
§Errors
Returns a PluginCreateError if plugin creation fails due to either:
- metadata name being unregistered,
- or the configuration is invalid, or
- some other reason specific to the plugin.
Sourcepub fn match_name(&self, name: &str, version: impl Into<ZarrVersions>) -> bool
pub fn match_name(&self, name: &str, version: impl Into<ZarrVersions>) -> bool
Returns true if this plugin is associated with name for the given Zarr version.
Sourcepub fn default_name(
&self,
version: impl Into<ZarrVersions>,
) -> Cow<'static, str>
pub fn default_name( &self, version: impl Into<ZarrVersions>, ) -> Cow<'static, str>
Return the default name for this plugin for the given Zarr version.
Sourcepub fn identifier(&self) -> &'static str
pub fn identifier(&self) -> &'static str
Returns the identifier of the plugin.
Trait Implementations§
Source§impl Deref for DataTypePlugin
impl Deref for DataTypePlugin
impl Collect for DataTypePlugin
Auto Trait Implementations§
impl Freeze for DataTypePlugin
impl Send for DataTypePlugin
impl Sync for DataTypePlugin
impl RefUnwindSafe for DataTypePlugin
impl Unpin for DataTypePlugin
impl UnwindSafe for DataTypePlugin
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