Skip to main content

ReadonlyRepository

Struct ReadonlyRepository 

Source
pub struct ReadonlyRepository<T: Entity = Row> { /* private fields */ }

Implementations§

Source§

impl<T: Entity> ReadonlyRepository<T>

Source

pub fn new( connection: Arc<dyn Connection>, options: ReadonlyRepositoryMappingOptions, ) -> Result<Self>

Source

pub fn schema(&self) -> &Schema

Source

pub fn from_built(built: BuiltRepository) -> Self

Source

pub fn add_enriched<TRelated: Entity>( &mut self, enrichment: Enrichment, via: impl EnrichmentVia<TRelated>, strategy: Option<Arc<dyn ReadonlyEnrichmentStrategy<T, TRelated>>>, ) -> &mut Self

Source

pub fn add_middleware(&mut self, middleware: Arc<dyn CommandMiddleware>)

Source

pub async fn read_single( &self, query: Option<&dyn Statement>, options: Option<&ReadonlyRepositoryMappingOptions>, ) -> Result<Option<T>>

Source

pub fn read<'a>( &'a self, query: Option<&'a dyn Statement>, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>

Source

pub async fn read_single_where( &self, clause: &dyn IWhere, options: Option<&ReadonlyRepositoryMappingOptions>, ) -> Result<Option<T>>

Source

pub fn read_where<'a>( &'a self, clause: &'a dyn IWhere, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>

Trait Implementations§

Source§

impl<T: Entity> IReadonlyRepository<T> for ReadonlyRepository<T>

Source§

fn read_single<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: Option<&'life1 dyn Statement>, options: Option<&'life2 ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn read<'a>( &'a self, query: Option<&'a dyn Statement>, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>

Source§

fn read_single_where<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, clause: &'life1 dyn IWhere, options: Option<&'life2 ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn read_where<'a>( &'a self, clause: &'a dyn IWhere, options: Option<&'a ReadonlyRepositoryMappingOptions>, ) -> Pin<Box<dyn Stream<Item = Result<T>> + Send + 'a>>

Source§

fn is_schema_required(&self) -> bool

Source§

fn to_crud(self: Arc<Self>) -> Option<Arc<dyn ICRUDRepository<T>>>
where Self: Sized,

Source§

impl<T: Entity> IRepository for ReadonlyRepository<T>

Auto Trait Implementations§

§

impl<T = HashMap<String, Value>> !RefUnwindSafe for ReadonlyRepository<T>

§

impl<T = HashMap<String, Value>> !UnwindSafe for ReadonlyRepository<T>

§

impl<T> Forget for ReadonlyRepository<T>

§

impl<T> Freeze for ReadonlyRepository<T>
where Arc<Mutex<Vec<StoredEnrichment<T>>>>: Freeze, PhantomData<T>: Freeze,

§

impl<T> Move for ReadonlyRepository<T>

§

impl<T> Send for ReadonlyRepository<T>
where Arc<Mutex<Vec<StoredEnrichment<T>>>>: Send, PhantomData<T>: Send,

§

impl<T> Sync for ReadonlyRepository<T>
where Arc<Mutex<Vec<StoredEnrichment<T>>>>: Sync, PhantomData<T>: Sync,

§

impl<T> Unpin for ReadonlyRepository<T>
where Arc<Mutex<Vec<StoredEnrichment<T>>>>: Unpin, PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for ReadonlyRepository<T>
where Arc<Mutex<Vec<StoredEnrichment<T>>>>: UnsafeUnpin, PhantomData<T>: UnsafeUnpin,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.