Skip to main content

Defective

Struct Defective 

Source
pub struct Defective<'a, R> { /* private fields */ }
Expand description

A backend with one Defect injected. The wrapped backend does the work.

Implementations§

Source§

impl<'a, R: RelationalBackend> Defective<'a, R>

Source

pub fn new(inner: &'a R, defect: Defect) -> Self

Wrap inner so it is wrong in exactly the way defect says.

Trait Implementations§

Source§

impl<'a, R: Debug> Debug for Defective<'a, R>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<R: RelationalBackend> Migrates for Defective<'_, R>

The known-bad migrator: no ledger, no checksum, no transaction. It runs each migration’s statements (split on ;) straight on the wrapped backend every time it is asked.

Source§

async fn migrate( &self, migrations: &[Migration], ) -> Result<MigrateReport, MigrateError>

Apply migrations in version order, skipping those already applied. Each migration runs in its own transaction where the database can; refuses (applying nothing further) if an applied migration’s text has changed, if the database has applied a version the program does not know, or if a migration is recorded as dirty.
Source§

async fn applied_versions(&self) -> Result<Vec<i64>, MigrateError>

The versions the ledger says succeeded, ascending; empty if there is no ledger yet.
Source§

impl<R: RelationalBackend> RelationalBackend for Defective<'_, R>

Source§

type Tx<'a> = DefectiveTx<'a, R> where Self: 'a

A transaction on this backend. Dropping it without commit rolls it back.
Source§

fn backend(&self) -> &str

The backend’s name as it appears in matrix rows (postgres).
Source§

fn version(&self) -> &str

The server version string as it appears in matrix rows (16.15).
Source§

fn dialect(&self) -> Dialect

The dialect statements must be written in.
Source§

async fn execute(&self, sql: &str, params: &[Value]) -> Result<u64, RelError>

Run a statement that returns no rows; the result is the number of rows affected.
Source§

async fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Row>, RelError>

Run a statement and return its rows.
Source§

async fn begin( &self, isolation: Isolation, ) -> Result<DefectiveTx<'_, R>, RelError>

Begin a transaction at (at least) isolation.

Auto Trait Implementations§

§

impl<'a, R> Freeze for Defective<'a, R>
where &'a R: Freeze,

§

impl<'a, R> RefUnwindSafe for Defective<'a, R>

§

impl<'a, R> Send for Defective<'a, R>
where &'a R: Send,

§

impl<'a, R> Sync for Defective<'a, R>
where &'a R: Sync,

§

impl<'a, R> Unpin for Defective<'a, R>
where &'a R: Unpin,

§

impl<'a, R> UnsafeUnpin for Defective<'a, R>

§

impl<'a, R> UnwindSafe for Defective<'a, R>

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.