#[non_exhaustive]pub struct PersistenceConfig {
pub persistence_mode: PersistenceMode,
pub rdb_snapshot_period: SnapshotPeriod,
pub rdb_next_snapshot_time: Option<Timestamp>,
pub rdb_snapshot_start_time: Option<Timestamp>,
/* private fields */
}Expand description
Configuration of the persistence functionality.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.persistence_mode: PersistenceModeOptional. Controls whether Persistence features are enabled. If not provided, the existing value will be used.
rdb_snapshot_period: SnapshotPeriodOptional. Period between RDB snapshots. Snapshots will be attempted every period starting from the provided snapshot start time. For example, a start time of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45, and 00:45 the next day, and so on. If not provided, TWENTY_FOUR_HOURS will be used as default.
rdb_next_snapshot_time: Option<Timestamp>Output only. The next time that a snapshot attempt is scheduled to occur.
rdb_snapshot_start_time: Option<Timestamp>Optional. Date and time that the first snapshot was/will be attempted, and to which future snapshots will be aligned. If not provided, the current time will be used.
Implementations§
Source§impl PersistenceConfig
impl PersistenceConfig
pub fn new() -> Self
Sourcepub fn set_persistence_mode<T: Into<PersistenceMode>>(self, v: T) -> Self
pub fn set_persistence_mode<T: Into<PersistenceMode>>(self, v: T) -> Self
Sets the value of persistence_mode.
§Example
use google_cloud_redis_v1::model::persistence_config::PersistenceMode;
let x0 = PersistenceConfig::new().set_persistence_mode(PersistenceMode::Disabled);
let x1 = PersistenceConfig::new().set_persistence_mode(PersistenceMode::Rdb);Sourcepub fn set_rdb_snapshot_period<T: Into<SnapshotPeriod>>(self, v: T) -> Self
pub fn set_rdb_snapshot_period<T: Into<SnapshotPeriod>>(self, v: T) -> Self
Sets the value of rdb_snapshot_period.
§Example
use google_cloud_redis_v1::model::persistence_config::SnapshotPeriod;
let x0 = PersistenceConfig::new().set_rdb_snapshot_period(SnapshotPeriod::OneHour);
let x1 = PersistenceConfig::new().set_rdb_snapshot_period(SnapshotPeriod::SixHours);
let x2 = PersistenceConfig::new().set_rdb_snapshot_period(SnapshotPeriod::TwelveHours);Sourcepub fn set_rdb_next_snapshot_time<T>(self, v: T) -> Self
pub fn set_rdb_next_snapshot_time<T>(self, v: T) -> Self
Sets the value of rdb_next_snapshot_time.
§Example
use wkt::Timestamp;
let x = PersistenceConfig::new().set_rdb_next_snapshot_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_rdb_next_snapshot_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_rdb_next_snapshot_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of rdb_next_snapshot_time.
§Example
use wkt::Timestamp;
let x = PersistenceConfig::new().set_or_clear_rdb_next_snapshot_time(Some(Timestamp::default()/* use setters */));
let x = PersistenceConfig::new().set_or_clear_rdb_next_snapshot_time(None::<Timestamp>);Sourcepub fn set_rdb_snapshot_start_time<T>(self, v: T) -> Self
pub fn set_rdb_snapshot_start_time<T>(self, v: T) -> Self
Sets the value of rdb_snapshot_start_time.
§Example
use wkt::Timestamp;
let x = PersistenceConfig::new().set_rdb_snapshot_start_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_rdb_snapshot_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_rdb_snapshot_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of rdb_snapshot_start_time.
§Example
use wkt::Timestamp;
let x = PersistenceConfig::new().set_or_clear_rdb_snapshot_start_time(Some(Timestamp::default()/* use setters */));
let x = PersistenceConfig::new().set_or_clear_rdb_snapshot_start_time(None::<Timestamp>);Trait Implementations§
Source§impl Clone for PersistenceConfig
impl Clone for PersistenceConfig
Source§fn clone(&self) -> PersistenceConfig
fn clone(&self) -> PersistenceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more