Struct rbatis::rbatis::Rbatis [−][src]
rbatis engine
Fields
pool: OnceCell<DBPool>
runtime_expr: RExprRuntime
runtime_py: PyRuntime
tx_manager: Arc<TxManager>
page_plugin: Box<dyn PagePlugin>
sql_intercepts: Vec<Box<dyn SqlIntercept>>
logic_plugin: Option<Box<dyn LogicDelete>>
log_plugin: Arc<Box<dyn LogPlugin>>
version_lock_plugin: Option<Box<dyn VersionLockPlugin>>
Implementations
impl Rbatis
[src]
pub fn new() -> Self
[src]
create an Rbatis
pub fn new_with_opt(option: RbatisOption) -> Self
[src]
new Rbatis from Option
pub fn new_wrapper(&self) -> Wrapper
[src]
try return an new wrapper,if not call the link() method,it will be panic!
pub fn new_wrapper_table<T>(&self) -> Wrapper where
T: CRUDTable,
[src]
T: CRUDTable,
try return an new wrapper and set table formats,if not call the link() method,it will be panic!
pub async fn link(&self, driver_url: &str) -> Result<(), Error>
[src]
link pool
pub async fn link_opt(
&self,
driver_url: &str,
pool_options: &DBPoolOptions
) -> Result<(), Error>
[src]
&self,
driver_url: &str,
pool_options: &DBPoolOptions
) -> Result<(), Error>
link pool by DBPoolOptions for example: let mut opt = PoolOptions::new(); opt.max_size = 20; rb.link_opt("mysql://root:123456@localhost:3306/test", &opt).await.unwrap();
pub async fn link_cfg(
&self,
connect_option: &DBConnectOption,
pool_options: &DBPoolOptions
) -> Result<(), Error>
[src]
&self,
connect_option: &DBConnectOption,
pool_options: &DBPoolOptions
) -> Result<(), Error>
link pool by DBConnectOption and DBPoolOptions for example: let db_cfg=DBConnectOption::from("mysql://root:123456@localhost:3306/test")?; rb.link_cfg(&db_cfg,PoolOptions::new());
pub fn set_log_plugin<T>(&mut self, arg: T) where
T: LogPlugin + 'static,
[src]
T: LogPlugin + 'static,
pub fn set_logic_plugin<T>(&mut self, arg: Option<T>) where
T: LogicDelete + 'static,
[src]
T: LogicDelete + 'static,
pub fn set_page_plugin<T>(&mut self, arg: T) where
T: PagePlugin + 'static,
[src]
T: PagePlugin + 'static,
pub fn add_sql_intercept<T>(&mut self, arg: T) where
T: SqlIntercept + 'static,
[src]
T: SqlIntercept + 'static,
pub fn set_sql_intercepts<T>(&mut self, arg: Vec<Box<dyn SqlIntercept>>)
[src]
pub fn get_pool(&self) -> Result<&DBPool, Error>
[src]
get conn pool
pub fn driver_type(&self) -> Result<DriverType, Error>
[src]
get driver type
pub async fn begin_tx_defer(
&self,
when_drop_commit: bool
) -> Result<TxGuard, Error>
[src]
&self,
when_drop_commit: bool
) -> Result<TxGuard, Error>
begin tx,if TxGuard Drop, tx will be commit(when_drop_commit==true) or rollback(when_drop_commit==false) tx_id must be 'tx:'+id,this method default is 'tx:'+uuid for example: let guard = RB.begin_tx_defer(true).await?; let v: serde_json::Value = RB.fetch(&guard.tx_id, "SELECT count(1) FROM biz_activity;").await?;
pub async fn begin_tx(&self) -> Result<String, Error>
[src]
begin tx,for new conn,return (String(context_id/tx_id),u64) tx_id must be 'tx:'+id,this method default is 'tx:'+uuid
for example: let tx_id = rb.begin_tx().await.unwrap(); let v: serde_json::Value = rb.fetch(&tx_id, "SELECT count(1) FROM biz_activity;").await.unwrap();
pub async fn begin_defer(
&self,
context_id: &str,
when_drop_commit: bool
) -> Result<TxGuard, Error>
[src]
&self,
context_id: &str,
when_drop_commit: bool
) -> Result<TxGuard, Error>
begin tx,if TxGuard Drop, tx will be commit(when_drop_commit==true) or rollback(when_drop_commit==false) arg context_id must be 'tx:***'
for example: let context_id = "tx:1"; let tx_id = rb.begin_defer(context_id,true).await.unwrap(); let v: serde_json::Value = rb.fetch(&tx_id, "SELECT count(1) FROM biz_activity;").await.unwrap();
pub async fn begin(&self, context_id: &str) -> Result<String, Error>
[src]
begin tx,for new conn,return <u64(tx num),Error> arg context_id must be 'tx:***'
for example: let context_id = "tx:1"; rb.begin(context_id).await.unwrap(); let v: serde_json::Value = rb.fetch(context_id, "SELECT count(1) FROM biz_activity;").await.unwrap(); println!("{}", v.clone()); rb.commit(context_id).await.unwrap();
pub async fn commit(&self, context_id: &str) -> Result<String, Error>
[src]
commit tx,and return conn,return <u64(tx num),Error>
pub async fn rollback(&self, context_id: &str) -> Result<String, Error>
[src]
rollback tx,and return conn,return <u64(tx num),Error>
pub async fn fetch<T>(&self, context_id: &str, sql: &str) -> Result<T, Error> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
fetch result(row sql)
for example: let v: serde_json::Value = rb.fetch(context_id, "SELECT count(1) FROM biz_activity;").await?;
pub async fn exec(
&self,
context_id: &str,
sql: &str
) -> Result<DBExecResult, Error>
[src]
&self,
context_id: &str,
sql: &str
) -> Result<DBExecResult, Error>
exec sql(row sql) for example: rb.exec("", "CREATE TABLE biz_uuid( id uuid, name VARCHAR, PRIMARY KEY(id));").await;
pub async fn fetch_prepare<T>(
&self,
context_id: &str,
sql: &str,
args: &Vec<Value>
) -> Result<T, Error> where
T: DeserializeOwned,
[src]
&self,
context_id: &str,
sql: &str,
args: &Vec<Value>
) -> Result<T, Error> where
T: DeserializeOwned,
fetch result(prepare sql)
for example:
let v = RB.fetch_prepare::
pub async fn exec_prepare(
&self,
context_id: &str,
sql: &str,
args: &Vec<Value>
) -> Result<DBExecResult, Error>
[src]
&self,
context_id: &str,
sql: &str,
args: &Vec<Value>
) -> Result<DBExecResult, Error>
exec sql(prepare sql)
for example:
let v = RB.exec_prepare::
pub async fn py_fetch<T, Arg>(
&self,
context_id: &str,
py_sql: &str,
arg: &Arg
) -> Result<T, Error> where
T: DeserializeOwned,
Arg: Serialize + Send + Sync,
[src]
&self,
context_id: &str,
py_sql: &str,
arg: &Arg
) -> Result<T, Error> where
T: DeserializeOwned,
Arg: Serialize + Send + Sync,
fetch query result(prepare sql) for example:
let py = r#" SELECT * FROM biz_activity WHERE delete_flag = #{delete_flag} if name != null: AND name like #{name+'%'} if ids != null: AND id in ( trim ',': for item in ids: #{item}, )"#; let data: serde_json::Value = rb.py_fetch("", py, &json!({ "delete_flag": 1 })).await.unwrap();
pub async fn py_exec<Arg>(
&self,
context_id: &str,
py_sql: &str,
arg: &Arg
) -> Result<DBExecResult, Error> where
Arg: Serialize + Send + Sync,
[src]
&self,
context_id: &str,
py_sql: &str,
arg: &Arg
) -> Result<DBExecResult, Error> where
Arg: Serialize + Send + Sync,
exec sql(prepare sql) for example:
let py = r#" SELECT * FROM biz_activity WHERE delete_flag = #{delete_flag} if name != null: AND name like #{name+'%'} if ids != null: AND id in ( trim ',': for item in ids: #{item}, )"#; let data: u64 = rb.py_exec("", py, &json!({ "delete_flag": 1 })).await.unwrap();
pub async fn fetch_page<T>(
&self,
context_id: &str,
sql: &str,
args: &Vec<Value>,
page_request: &dyn IPageRequest
) -> Result<Page<T>, Error> where
T: DeserializeOwned + Serialize + Send + Sync,
[src]
&self,
context_id: &str,
sql: &str,
args: &Vec<Value>,
page_request: &dyn IPageRequest
) -> Result<Page<T>, Error> where
T: DeserializeOwned + Serialize + Send + Sync,
fetch page result(prepare sql)
pub async fn py_fetch_page<T, Arg>(
&self,
context_id: &str,
py_sql: &str,
arg: &Arg,
page_request: &dyn IPageRequest
) -> Result<Page<T>, Error> where
T: DeserializeOwned + Serialize + Send + Sync,
Arg: Serialize + Send + Sync,
[src]
&self,
context_id: &str,
py_sql: &str,
arg: &Arg,
page_request: &dyn IPageRequest
) -> Result<Page<T>, Error> where
T: DeserializeOwned + Serialize + Send + Sync,
Arg: Serialize + Send + Sync,
fetch result(prepare sql)
Trait Implementations
impl CRUD for Rbatis
[src]
fn save_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
entity: &'life2 T,
w: &'life3 Wrapper
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
entity: &'life2 T,
w: &'life3 Wrapper
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
save by wrapper
fn save<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
entity: &'life2 T
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
entity: &'life2 T
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
save one entity to database
fn save_batch<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
args: &'life2 [T]
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
args: &'life2 [T]
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
save batch makes many value into only one sql. make sure your data not to long!
for Example: rb.save_batch(&vec![activity]); [rbatis] Exec ==> INSERT INTO biz_activity (id,name,version) VALUES ( ? , ? , ?),( ? , ? , ?)
fn remove_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
remove database record by a wrapper
fn remove_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
id: &'life2 T::IdType
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
id: &'life2 T::IdType
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
remove database record by id
fn remove_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
remove batch id
for Example :
rb.remove_batch_by_id::
fn update_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
arg: &'life2 mut T,
w: &'life3 Wrapper,
update_null_value: bool
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
arg: &'life2 mut T,
w: &'life3 Wrapper,
update_null_value: bool
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
update arg by wrapper
fn update_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
arg: &'life2 mut T
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
arg: &'life2 mut T
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
update database record by id
fn update_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
args: &'life2 mut [T]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
args: &'life2 mut [T]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
remove batch database record by args
fn fetch_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fetch database record by a wrapper
fn fetch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
id: &'life2 T::IdType
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
id: &'life2 T::IdType
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fetch database record by id
fn fetch_list_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fetch database record list by a wrapper
fn fetch_list<'life0, 'life1, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fetch database record list for all
fn fetch_list_by_ids<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fetch database record list by a id array
fn fetch_page_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper,
page: &'life3 dyn IPageRequest
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
context_id: &'life1 str,
w: &'life2 Wrapper,
page: &'life3 dyn IPageRequest
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>> where
T: CRUDTable,
T: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fetch page database record list by a wrapper
impl Debug for Rbatis
[src]
impl Default for Rbatis
[src]
impl Drop for Rbatis
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Rbatis
[src]
impl Send for Rbatis
[src]
impl Sync for Rbatis
[src]
impl Unpin for Rbatis
[src]
impl !UnwindSafe for Rbatis
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Conv for T
impl<T> Conv for T
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
T: ?Sized,
pub fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_ref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
pub fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_as_mut<'a, U, R>(
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
pub fn pipe_deref_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Tap for T
pub fn tap(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
pub fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
impl<T> TryConv for T
impl<T> TryConv for T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,