pub struct MigrationContext<'a> { /* private fields */ }Implementations§
Source§impl<'a> MigrationContext<'a>
impl<'a> MigrationContext<'a>
pub fn new(prefix: String, storage: &'a mut dyn MigrationBackendAdapter) -> Self
pub fn nested<TOld, TNew>(&mut self, key: &str, old_data: TOld) -> Result<TNew>
pub fn delete(&mut self, key: &str) -> Result<()>
pub fn rename(&mut self, from: &str, to: &str) -> Result<()>
pub fn transform<TOld, TNew>(
&mut self,
key: &str,
f: impl FnOnce(TOld) -> Result<TNew>,
) -> Result<()>where
TOld: DeserializeOwned,
TNew: Serialize,
pub fn merge<TOld1, TOld2, TNew>( &mut self, from: (&str, &str), into: &str, f: impl FnOnce(TOld1, TOld2) -> Result<TNew>, ) -> Result<()>
pub fn split<TOld, TNew1, TNew2>( &mut self, from: &str, into: (&str, &str), f: impl FnOnce(TOld) -> Result<(TNew1, TNew2)>, ) -> Result<()>
pub fn get<T: DeserializeOwned>(&self, key: &str) -> Result<Option<T>>
pub fn set<T: Serialize>(&mut self, key: &str, value: &T) -> Result<()>
pub fn global_get<T: DeserializeOwned>( &self, full_key: &str, ) -> Result<Option<T>>
pub fn global_set<T: Serialize>( &mut self, full_key: &str, value: &T, ) -> Result<()>
pub fn get_raw(&self, key: &str) -> Result<Option<Vec<u8>>>
pub fn set_raw(&mut self, key: &str, value: &[u8]) -> Result<()>
pub fn scoped(&mut self, sub_prefix: &str) -> MigrationContext<'_>
pub fn scan_map<K, V>(&self, key: &str) -> Result<HashMap<K, V>>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MigrationContext<'a>
impl<'a> !Send for MigrationContext<'a>
impl<'a> !Sync for MigrationContext<'a>
impl<'a> !UnwindSafe for MigrationContext<'a>
impl<'a> Freeze for MigrationContext<'a>
impl<'a> Unpin for MigrationContext<'a>
impl<'a> UnsafeUnpin for MigrationContext<'a>
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