StoreBackend::Data: don't require Sized
This commit is contained in:
parent
4db466ffc4
commit
c3e294d211
@ -1,6 +1,6 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
use core::{mem::size_of, str};
|
use core::str;
|
||||||
use byteorder::{ByteOrder, BigEndian};
|
use byteorder::{ByteOrder, BigEndian};
|
||||||
#[cfg(feature = "postcard-values")]
|
#[cfg(feature = "postcard-values")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -14,12 +14,12 @@ mod test;
|
|||||||
|
|
||||||
/// Backend interface for `Store`
|
/// Backend interface for `Store`
|
||||||
pub trait StoreBackend {
|
pub trait StoreBackend {
|
||||||
type Data: Sized + AsRef<[u8]>;
|
type Data: ?Sized + AsRef<[u8]>;
|
||||||
|
|
||||||
/// Memory-mapped
|
/// Memory-mapped
|
||||||
fn data(&self) -> &Self::Data;
|
fn data(&self) -> &Self::Data;
|
||||||
fn len(&self) -> usize {
|
fn len(&self) -> usize {
|
||||||
size_of::<Self::Data>()
|
self.data().as_ref().len()
|
||||||
}
|
}
|
||||||
|
|
||||||
type Error;
|
type Error;
|
||||||
|
Loading…
Reference in New Issue
Block a user