#[non_exhaustive]pub struct PersistenceConfig {
pub mode: PersistenceMode,
pub rdb_config: Option<RDBConfig>,
pub aof_config: Option<AOFConfig>,
/* private fields */
}Expand description
Represents persistence configuration for a instance.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mode: PersistenceModeOptional. Current persistence mode.
rdb_config: Option<RDBConfig>Optional. RDB configuration. This field will be ignored if mode is not RDB.
aof_config: Option<AOFConfig>Optional. AOF configuration. This field will be ignored if mode is not AOF.
Implementations§
Source§impl PersistenceConfig
impl PersistenceConfig
pub fn new() -> Self
Sourcepub fn set_mode<T: Into<PersistenceMode>>(self, v: T) -> Self
pub fn set_mode<T: Into<PersistenceMode>>(self, v: T) -> Self
Sets the value of mode.
§Example
ⓘ
use google_cloud_memorystore_v1::model::persistence_config::PersistenceMode;
let x0 = PersistenceConfig::new().set_mode(PersistenceMode::Disabled);
let x1 = PersistenceConfig::new().set_mode(PersistenceMode::Rdb);
let x2 = PersistenceConfig::new().set_mode(PersistenceMode::Aof);Sourcepub fn set_rdb_config<T>(self, v: T) -> Self
pub fn set_rdb_config<T>(self, v: T) -> Self
Sets the value of rdb_config.
§Example
ⓘ
use google_cloud_memorystore_v1::model::persistence_config::RDBConfig;
let x = PersistenceConfig::new().set_rdb_config(RDBConfig::default()/* use setters */);Sourcepub fn set_or_clear_rdb_config<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_rdb_config<T>(self, v: Option<T>) -> Self
Sets or clears the value of rdb_config.
§Example
ⓘ
use google_cloud_memorystore_v1::model::persistence_config::RDBConfig;
let x = PersistenceConfig::new().set_or_clear_rdb_config(Some(RDBConfig::default()/* use setters */));
let x = PersistenceConfig::new().set_or_clear_rdb_config(None::<RDBConfig>);Sourcepub fn set_aof_config<T>(self, v: T) -> Self
pub fn set_aof_config<T>(self, v: T) -> Self
Sets the value of aof_config.
§Example
ⓘ
use google_cloud_memorystore_v1::model::persistence_config::AOFConfig;
let x = PersistenceConfig::new().set_aof_config(AOFConfig::default()/* use setters */);Sourcepub fn set_or_clear_aof_config<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_aof_config<T>(self, v: Option<T>) -> Self
Sets or clears the value of aof_config.
§Example
ⓘ
use google_cloud_memorystore_v1::model::persistence_config::AOFConfig;
let x = PersistenceConfig::new().set_or_clear_aof_config(Some(AOFConfig::default()/* use setters */));
let x = PersistenceConfig::new().set_or_clear_aof_config(None::<AOFConfig>);Trait Implementations§
Source§impl Clone for PersistenceConfig
impl Clone for PersistenceConfig
Source§fn clone(&self) -> PersistenceConfig
fn clone(&self) -> PersistenceConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PersistenceConfig
impl Debug for PersistenceConfig
Source§impl Default for PersistenceConfig
impl Default for PersistenceConfig
Source§fn default() -> PersistenceConfig
fn default() -> PersistenceConfig
Returns the “default value” for a type. Read more
Source§impl Message for PersistenceConfig
impl Message for PersistenceConfig
Source§impl PartialEq for PersistenceConfig
impl PartialEq for PersistenceConfig
impl StructuralPartialEq for PersistenceConfig
Auto Trait Implementations§
impl Freeze for PersistenceConfig
impl RefUnwindSafe for PersistenceConfig
impl Send for PersistenceConfig
impl Sync for PersistenceConfig
impl Unpin for PersistenceConfig
impl UnwindSafe for PersistenceConfig
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