#[non_exhaustive]pub struct Condition {
pub type: String,
pub state: State,
pub message: String,
pub last_transition_time: Option<Timestamp>,
pub severity: Severity,
pub reasons: Option<Reasons>,
/* private fields */
}Expand description
Defines a status condition for a resource.
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.type: Stringtype is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include:
- “Ready”: True when the Resource is ready.
state: StateState of the condition.
message: StringHuman readable message indicating details about the current status.
last_transition_time: Option<Timestamp>Last time the condition transitioned from one status to another.
severity: SeverityHow to interpret failures of this condition, one of Error, Warning, Info
reasons: Option<Reasons>The reason for this condition. Depending on the condition type, it will populate one of these fields. Successful conditions cannot have a reason.
Implementations§
Source§impl Condition
impl Condition
Sourcepub fn set_message<T: Into<String>>(self, v: T) -> Self
pub fn set_message<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_last_transition_time<T>(self, v: T) -> Self
pub fn set_last_transition_time<T>(self, v: T) -> Self
Sets the value of last_transition_time.
§Example
use wkt::Timestamp;
let x = Condition::new().set_last_transition_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_last_transition_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_last_transition_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of last_transition_time.
§Example
use wkt::Timestamp;
let x = Condition::new().set_or_clear_last_transition_time(Some(Timestamp::default()/* use setters */));
let x = Condition::new().set_or_clear_last_transition_time(None::<Timestamp>);Sourcepub fn set_severity<T: Into<Severity>>(self, v: T) -> Self
pub fn set_severity<T: Into<Severity>>(self, v: T) -> Self
Sourcepub fn set_reasons<T: Into<Option<Reasons>>>(self, v: T) -> Self
pub fn set_reasons<T: Into<Option<Reasons>>>(self, v: T) -> Self
Sets the value of reasons.
Note that all the setters affecting reasons are mutually
exclusive.
§Example
use google_cloud_run_v2::model::condition::CommonReason;
let x0 = Condition::new().set_reasons(Some(
google_cloud_run_v2::model::condition::Reasons::Reason(CommonReason::Unknown)));
let x1 = Condition::new().set_reasons(Some(
google_cloud_run_v2::model::condition::Reasons::Reason(CommonReason::RevisionFailed)));
let x2 = Condition::new().set_reasons(Some(
google_cloud_run_v2::model::condition::Reasons::Reason(CommonReason::ProgressDeadlineExceeded)));Sourcepub fn reason(&self) -> Option<&CommonReason>
pub fn reason(&self) -> Option<&CommonReason>
The value of reasons
if it holds a Reason, None if the field is not set or
holds a different branch.
Sourcepub fn set_reason<T: Into<CommonReason>>(self, v: T) -> Self
pub fn set_reason<T: Into<CommonReason>>(self, v: T) -> Self
Sets the value of reasons
to hold a Reason.
Note that all the setters affecting reasons are
mutually exclusive.
§Example
use google_cloud_run_v2::model::condition::CommonReason;
let x0 = Condition::new().set_reason(CommonReason::Unknown);
let x1 = Condition::new().set_reason(CommonReason::RevisionFailed);
let x2 = Condition::new().set_reason(CommonReason::ProgressDeadlineExceeded);
assert!(x0.reason().is_some());
assert!(x0.revision_reason().is_none());
assert!(x0.execution_reason().is_none());
assert!(x1.reason().is_some());
assert!(x1.revision_reason().is_none());
assert!(x1.execution_reason().is_none());
assert!(x2.reason().is_some());
assert!(x2.revision_reason().is_none());
assert!(x2.execution_reason().is_none());Sourcepub fn revision_reason(&self) -> Option<&RevisionReason>
pub fn revision_reason(&self) -> Option<&RevisionReason>
The value of reasons
if it holds a RevisionReason, None if the field is not set or
holds a different branch.
Sourcepub fn set_revision_reason<T: Into<RevisionReason>>(self, v: T) -> Self
pub fn set_revision_reason<T: Into<RevisionReason>>(self, v: T) -> Self
Sets the value of reasons
to hold a RevisionReason.
Note that all the setters affecting reasons are
mutually exclusive.
§Example
use google_cloud_run_v2::model::condition::RevisionReason;
let x0 = Condition::new().set_revision_reason(RevisionReason::Pending);
let x1 = Condition::new().set_revision_reason(RevisionReason::Reserve);
let x2 = Condition::new().set_revision_reason(RevisionReason::Retired);
assert!(x0.revision_reason().is_some());
assert!(x0.reason().is_none());
assert!(x0.execution_reason().is_none());
assert!(x1.revision_reason().is_some());
assert!(x1.reason().is_none());
assert!(x1.execution_reason().is_none());
assert!(x2.revision_reason().is_some());
assert!(x2.reason().is_none());
assert!(x2.execution_reason().is_none());Sourcepub fn execution_reason(&self) -> Option<&ExecutionReason>
pub fn execution_reason(&self) -> Option<&ExecutionReason>
The value of reasons
if it holds a ExecutionReason, None if the field is not set or
holds a different branch.
Sourcepub fn set_execution_reason<T: Into<ExecutionReason>>(self, v: T) -> Self
pub fn set_execution_reason<T: Into<ExecutionReason>>(self, v: T) -> Self
Sets the value of reasons
to hold a ExecutionReason.
Note that all the setters affecting reasons are
mutually exclusive.
§Example
use google_cloud_run_v2::model::condition::ExecutionReason;
let x0 = Condition::new().set_execution_reason(ExecutionReason::JobStatusServicePollingError);
let x1 = Condition::new().set_execution_reason(ExecutionReason::NonZeroExitCode);
let x2 = Condition::new().set_execution_reason(ExecutionReason::Cancelled);
assert!(x0.execution_reason().is_some());
assert!(x0.reason().is_none());
assert!(x0.revision_reason().is_none());
assert!(x1.execution_reason().is_some());
assert!(x1.reason().is_none());
assert!(x1.revision_reason().is_none());
assert!(x2.execution_reason().is_some());
assert!(x2.reason().is_none());
assert!(x2.revision_reason().is_none());Trait Implementations§
impl StructuralPartialEq for Condition
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnsafeUnpin for Condition
impl UnwindSafe for Condition
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