pub struct EmergencyAdmin { /* private fields */ }Expand description
Admin handle bound to a kernel and a configured admin token.
The handle is cheap to clone (Arc<ChioKernel> + short strings) and
safe to share across threads. It holds the only reference to the
kernel needed by the emergency endpoints, so substrate adapters can
construct one EmergencyAdmin at startup and pass it to every
route registration.
Implementations§
Source§impl EmergencyAdmin
impl EmergencyAdmin
Sourcepub fn new(kernel: Arc<ChioKernel>, expected_admin_token: String) -> Self
pub fn new(kernel: Arc<ChioKernel>, expected_admin_token: String) -> Self
Create a new admin handle. expected_admin_token must match the
value of the X-Admin-Token header on every incoming admin call.
The token is compared with ==; adapters that need constant-time
comparison can wrap the check in their own middleware before
delegating to the handler.
Sourcepub fn kernel(&self) -> &Arc<ChioKernel>
pub fn kernel(&self) -> &Arc<ChioKernel>
Shared kernel reference, primarily for tests and for adapters
that want to re-use the same Arc<ChioKernel> for other routes.
Trait Implementations§
Source§impl Clone for EmergencyAdmin
impl Clone for EmergencyAdmin
Source§fn clone(&self) -> EmergencyAdmin
fn clone(&self) -> EmergencyAdmin
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 moreAuto Trait Implementations§
impl Freeze for EmergencyAdmin
impl !RefUnwindSafe for EmergencyAdmin
impl Send for EmergencyAdmin
impl Sync for EmergencyAdmin
impl Unpin for EmergencyAdmin
impl UnsafeUnpin for EmergencyAdmin
impl !UnwindSafe for EmergencyAdmin
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