Skip to main content

SingleLayerDataset

Struct SingleLayerDataset 

Source
pub struct SingleLayerDataset<L: Layer> {
    pub inner: Arc<L>,
    pub name: String,
}
Expand description

Adapter that wraps any Layer in a Dataset facade with one sentinel layer name. Use this when a single-layer format like Shapefile needs to satisfy a Dataset interface.

Fields§

§inner: Arc<L>

The wrapped layer. Arc so the adapter is cheap to clone and the closure inside open_layer can hand out a borrowed reference.

§name: String

The synthetic layer name surfaced via Dataset::layer_names. Default "default".

Implementations§

Source§

impl<L: Layer> SingleLayerDataset<L>

Source

pub fn new(layer: L) -> Self

Source

pub fn with_name(layer: L, name: impl Into<String>) -> Self

Trait Implementations§

Source§

impl<L: Layer + 'static> Dataset for SingleLayerDataset<L>

Source§

fn layer_names(&self) -> Vec<String>

Names of the user-facing layers in deterministic order.
Source§

fn open_layer<'a>(&'a self, name: &str) -> Result<Box<dyn Layer + 'a>>

Open the layer with the given name. Returns Error::LayerNotFound if the name isn’t present.
Source§

impl<L: Debug + Layer> Debug for SingleLayerDataset<L>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L> Freeze for SingleLayerDataset<L>

§

impl<L> RefUnwindSafe for SingleLayerDataset<L>
where L: RefUnwindSafe,

§

impl<L> Send for SingleLayerDataset<L>
where L: Sync + Send,

§

impl<L> Sync for SingleLayerDataset<L>
where L: Sync + Send,

§

impl<L> Unpin for SingleLayerDataset<L>

§

impl<L> UnsafeUnpin for SingleLayerDataset<L>

§

impl<L> UnwindSafe for SingleLayerDataset<L>
where L: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.