pub struct TableMapperRegistry {
pub mappers: HashMap<String, TableMapper>,
}
Expand description
The registry hold all table mappers togheter.
Fields
mappers: HashMap<String, TableMapper>
Implementations
sourceimpl TableMapperRegistry
impl TableMapperRegistry
sourcepub fn new() -> TableMapperRegistry
pub fn new() -> TableMapperRegistry
Create new registry.
sourcepub fn get(&self, table_name: &str) -> Option<&TableMapper>
pub fn get(&self, table_name: &str) -> Option<&TableMapper>
Get a mapper for a table name.
sourcepub fn insert(&mut self, mapper: TableMapper)
pub fn insert(&mut self, mapper: TableMapper)
Insert a mapper. Take the table name from the mapper.
sourcepub fn insert_new_mapper<M: Mapped>(&mut self) -> Result<String>
pub fn insert_new_mapper<M: Mapped>(&mut self) -> Result<String>
Insert a mapper for a given struct. The Mapped trait is implemented for every Topql derived struct.
sourcepub fn insert_new_mapper_with_handler<M: Mapped, H>(
&mut self,
handler: H
) -> Result<String> where
H: 'static + FieldHandler + Send + Sync,
pub fn insert_new_mapper_with_handler<M: Mapped, H>(
&mut self,
handler: H
) -> Result<String> where
H: 'static + FieldHandler + Send + Sync,
Insert a mapper for a given struct with a FieldHandler This allows a custom field handler for a given struct. The Mapped trait is implemented for every Topql derived struct.
Trait Implementations
sourceimpl Debug for TableMapperRegistry
impl Debug for TableMapperRegistry
Auto Trait Implementations
impl !RefUnwindSafe for TableMapperRegistry
impl Send for TableMapperRegistry
impl Sync for TableMapperRegistry
impl Unpin for TableMapperRegistry
impl !UnwindSafe for TableMapperRegistry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more