Skip to main content

ExtensionName

Trait ExtensionName 

Source
pub trait ExtensionName {
    // Required method
    fn name(&self, version: ZarrVersion) -> Option<Cow<'static, str>>;

    // Provided methods
    fn name_v3(&self) -> Option<Cow<'static, str>> { ... }
    fn name_v2(&self) -> Option<Cow<'static, str>> { ... }
}
Expand description

Object-safe trait for getting the name of an extension instance.

This trait provides a way to get the serialization name for an extension instance for a given Zarr version. The default implementation (via ExtensionNameStatic) returns the first alias from ExtensionAliases for that version.

Types can implement this trait manually if they need custom naming behavior.

Required Methods§

Source

fn name(&self, version: ZarrVersion) -> Option<Cow<'static, str>>

Get the name for this extension instance for the given Zarr version.

Returns None if this extension does not support the given version.

Provided Methods§

Source

fn name_v3(&self) -> Option<Cow<'static, str>>

Get the name for this extension instance for Zarr V3.

Returns None if this extension does not support V3.

Source

fn name_v2(&self) -> Option<Cow<'static, str>>

Get the name for this extension instance for Zarr V2.

Returns None if this extension does not support V2.

Implementations on Foreign Types§

Source§

impl<T: ExtensionName + ?Sized> ExtensionName for Arc<T>

Source§

fn name(&self, version: ZarrVersion) -> Option<Cow<'static, str>>

Implementors§