pub struct Exclusive;Expand description
Mode::Exclusive as a type, for the bound
Opens sets.
§Examples
use ruststream_sqlx_dialect::{
Dialect, Mode, Opening, Opens, Statement, StatementError, TableSpec, level,
};
/// libSQL, a fork of SQLite served over the network, a database without a built-in dialect.
#[derive(Debug)]
pub struct Libsql;
impl Dialect for Libsql {
fn name(&self) -> &'static str {
"libsql"
}
fn begin(&self, opening: Opening) -> Result<Option<&'static str>, StatementError> {
match opening {
Opening::Default => Ok(None),
Opening::Mode(Mode::Exclusive) => Ok(Some("BEGIN EXCLUSIVE")),
other => Err(StatementError::UnsupportedOpening {
dialect: self.name(),
opening: other.name(),
}),
}
}
}
// A table with `mode = exclusive` mounts on `Libsql`.
impl Opens<level::Exclusive> for Libsql {}Trait Implementations§
impl Copy for Exclusive
impl Eq for Exclusive
impl Opens<Exclusive> for Sqlite
impl StructuralPartialEq for Exclusive
Auto Trait Implementations§
impl Freeze for Exclusive
impl RefUnwindSafe for Exclusive
impl Send for Exclusive
impl Sync for Exclusive
impl Unpin for Exclusive
impl UnsafeUnpin for Exclusive
impl UnwindSafe for Exclusive
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more