pub struct EdgeStatusControl { /* private fields */ }Expand description
Switches an edge to read-only and back (spec 3.5 §7.9, A-I11).
Switching the edge to read-only is one of the two incident acts an owner may pre-authorise; a back-office tool holds this handle, never the edge itself. Each switch publishes the signed status it implies.
§Example
let control = edge.status_control();
control.read_only("drift_detected").await?;
// ... rollback to the last signed release ...
control.resume().await?;Implementations§
Source§impl EdgeStatusControl
impl EdgeStatusControl
Sourcepub async fn read_only(
&self,
reason: &str,
) -> Result<Option<SiteStatus>, StatusError>
pub async fn read_only( &self, reason: &str, ) -> Result<Option<SiteStatus>, StatusError>
Puts the edge in read-only mode for reason, a snake_case code such as
drift_detected, and publishes a read_only status.
§Errors
StatusError when the status cannot be signed or stored; the mode still changes.
Sourcepub async fn resume(&self) -> Result<Option<SiteStatus>, StatusError>
pub async fn resume(&self) -> Result<Option<SiteStatus>, StatusError>
Returns the edge to serving and publishes an operational status.
§Errors
StatusError when the status cannot be signed or stored; the mode still changes.
Sourcepub fn mode(&self) -> EdgeMode
pub fn mode(&self) -> EdgeMode
The edge’s mode; the kill switch is reported by is_read_only.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Whether non-read-only capabilities are refused: read-only mode or the kill switch.
Sourcepub async fn status(&self) -> Option<SiteStatus>
pub async fn status(&self) -> Option<SiteStatus>
The current signed status, if one was published.
Trait Implementations§
Source§impl Clone for EdgeStatusControl
impl Clone for EdgeStatusControl
Auto Trait Implementations§
impl !RefUnwindSafe for EdgeStatusControl
impl !UnwindSafe for EdgeStatusControl
impl Forget for EdgeStatusControl
impl Freeze for EdgeStatusControl
impl Move for EdgeStatusControl
impl Send for EdgeStatusControl
impl Sync for EdgeStatusControl
impl Unpin for EdgeStatusControl
impl UnsafeUnpin for EdgeStatusControlwhere
*const ArcInner<EdgeControl> is !null: UnsafeUnpin,
PhantomData<ArcInner<EdgeControl>>: UnsafeUnpin,
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more