#[non_exhaustive]pub struct RestoreDatabaseMetadata {
pub name: String,
pub source_type: RestoreSourceType,
pub progress: Option<OperationProgress>,
pub cancel_time: Option<Timestamp>,
pub optimize_database_operation_name: String,
pub source_info: Option<SourceInfo>,
/* private fields */
}Expand description
Metadata type for the long-running operation returned by RestoreDatabase.
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.name: StringName of the database being created and restored to.
source_type: RestoreSourceTypeThe type of the restore source.
progress: Option<OperationProgress>The progress of the RestoreDatabase operation.
cancel_time: Option<Timestamp>The time at which cancellation of this operation was received.
[Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
starts asynchronous cancellation on a long-running operation. The server
makes a best effort to cancel the operation, but success is not guaranteed.
Clients can use
[Operations.GetOperation][google.longrunning.Operations.GetOperation] or
other methods to check whether the cancellation succeeded or whether the
operation completed despite cancellation. On successful cancellation,
the operation is not deleted; instead, it becomes an operation with
an Operation.error value with a
google.rpc.Status.code of 1, corresponding to
Code.CANCELLED.
optimize_database_operation_name: StringIf exists, the name of the long-running operation that will be used to
track the post-restore optimization process to optimize the performance of
the restored database, and remove the dependency on the restore source.
The name is of the form
projects/<project>/instances/<instance>/databases/<database>/operations/<operation>
where the <database> is the name of database being created and restored to.
The metadata type of the long-running operation is
OptimizeRestoredDatabaseMetadata.
This long-running operation will be automatically created by the system
after the RestoreDatabase long-running operation completes successfully.
This operation will not be created if the restore was not successful.
source_info: Option<SourceInfo>Information about the source used to restore the database, as specified by
source in
RestoreDatabaseRequest.
Implementations§
Source§impl RestoreDatabaseMetadata
impl RestoreDatabaseMetadata
Sourcepub fn set_source_type<T: Into<RestoreSourceType>>(self, v: T) -> Self
pub fn set_source_type<T: Into<RestoreSourceType>>(self, v: T) -> Self
Sets the value of source_type.
§Example
use google_cloud_spanner_admin_database_v1::model::RestoreSourceType;
let x0 = RestoreDatabaseMetadata::new().set_source_type(RestoreSourceType::Backup);Sourcepub fn set_progress<T>(self, v: T) -> Selfwhere
T: Into<OperationProgress>,
pub fn set_progress<T>(self, v: T) -> Selfwhere
T: Into<OperationProgress>,
Sourcepub fn set_or_clear_progress<T>(self, v: Option<T>) -> Selfwhere
T: Into<OperationProgress>,
pub fn set_or_clear_progress<T>(self, v: Option<T>) -> Selfwhere
T: Into<OperationProgress>,
Sets or clears the value of progress.
§Example
use google_cloud_spanner_admin_database_v1::model::OperationProgress;
let x = RestoreDatabaseMetadata::new().set_or_clear_progress(Some(OperationProgress::default()/* use setters */));
let x = RestoreDatabaseMetadata::new().set_or_clear_progress(None::<OperationProgress>);Sourcepub fn set_cancel_time<T>(self, v: T) -> Self
pub fn set_cancel_time<T>(self, v: T) -> Self
Sets the value of cancel_time.
§Example
use wkt::Timestamp;
let x = RestoreDatabaseMetadata::new().set_cancel_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_cancel_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_cancel_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of cancel_time.
§Example
use wkt::Timestamp;
let x = RestoreDatabaseMetadata::new().set_or_clear_cancel_time(Some(Timestamp::default()/* use setters */));
let x = RestoreDatabaseMetadata::new().set_or_clear_cancel_time(None::<Timestamp>);Sourcepub fn set_optimize_database_operation_name<T: Into<String>>(self, v: T) -> Self
pub fn set_optimize_database_operation_name<T: Into<String>>(self, v: T) -> Self
Sets the value of optimize_database_operation_name.
§Example
let x = RestoreDatabaseMetadata::new().set_optimize_database_operation_name("example");Sourcepub fn set_source_info<T: Into<Option<SourceInfo>>>(self, v: T) -> Self
pub fn set_source_info<T: Into<Option<SourceInfo>>>(self, v: T) -> Self
Sets the value of source_info.
Note that all the setters affecting source_info are mutually
exclusive.
§Example
use google_cloud_spanner_admin_database_v1::model::BackupInfo;
let x = RestoreDatabaseMetadata::new().set_source_info(Some(
google_cloud_spanner_admin_database_v1::model::restore_database_metadata::SourceInfo::BackupInfo(BackupInfo::default().into())));Sourcepub fn backup_info(&self) -> Option<&Box<BackupInfo>>
pub fn backup_info(&self) -> Option<&Box<BackupInfo>>
The value of source_info
if it holds a BackupInfo, None if the field is not set or
holds a different branch.
Sourcepub fn set_backup_info<T: Into<Box<BackupInfo>>>(self, v: T) -> Self
pub fn set_backup_info<T: Into<Box<BackupInfo>>>(self, v: T) -> Self
Sets the value of source_info
to hold a BackupInfo.
Note that all the setters affecting source_info are
mutually exclusive.
§Example
use google_cloud_spanner_admin_database_v1::model::BackupInfo;
let x = RestoreDatabaseMetadata::new().set_backup_info(BackupInfo::default()/* use setters */);
assert!(x.backup_info().is_some());Trait Implementations§
Source§impl Clone for RestoreDatabaseMetadata
impl Clone for RestoreDatabaseMetadata
Source§fn clone(&self) -> RestoreDatabaseMetadata
fn clone(&self) -> RestoreDatabaseMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RestoreDatabaseMetadata
impl Debug for RestoreDatabaseMetadata
Source§impl Default for RestoreDatabaseMetadata
impl Default for RestoreDatabaseMetadata
Source§fn default() -> RestoreDatabaseMetadata
fn default() -> RestoreDatabaseMetadata
Source§impl Message for RestoreDatabaseMetadata
impl Message for RestoreDatabaseMetadata
Source§impl PartialEq for RestoreDatabaseMetadata
impl PartialEq for RestoreDatabaseMetadata
impl StructuralPartialEq for RestoreDatabaseMetadata
Auto Trait Implementations§
impl Freeze for RestoreDatabaseMetadata
impl RefUnwindSafe for RestoreDatabaseMetadata
impl Send for RestoreDatabaseMetadata
impl Sync for RestoreDatabaseMetadata
impl Unpin for RestoreDatabaseMetadata
impl UnsafeUnpin for RestoreDatabaseMetadata
impl UnwindSafe for RestoreDatabaseMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request