pub struct AdminConfig {
pub snapshot: Option<SnapshotAdminConfig>,
pub wal: Option<Arc<dyn WalAdmin>>,
}Expand description
Configuration for the admin surface. Snapshot and WAL admin are
independent: each set of routes mounts only when its corresponding
field is Some.
snapshot.is_some()mountsPOST /admin/snapshot/saveandPOST /admin/snapshot/loadagainst the configured path (the body’s optionalpathfield overrides per request).wal.is_some()mountsPOST /admin/wal/statusandPOST /admin/wal/truncateunconditionally, plusPOST /admin/checkpoint(which usessnapshot.pathas a default when present, and otherwise requirespathin the request body).
The endpoints are intentionally opt-in: exposing them without
authentication on a network-reachable interface is a footgun, so
the caller must explicitly construct an AdminConfig and pass it
to the server — there is no implicit default path.
Fields§
§snapshot: Option<SnapshotAdminConfig>Snapshot save/load admin. None to disable
/admin/snapshot/{save,load}.
wal: Option<Arc<dyn WalAdmin>>WAL admin. None to disable /admin/wal/* and
/admin/checkpoint.
Implementations§
Source§impl AdminConfig
impl AdminConfig
Sourcepub fn snapshot_only(
snapshot_path: PathBuf,
admin: Arc<dyn SnapshotAdmin>,
) -> Self
pub fn snapshot_only( snapshot_path: PathBuf, admin: Arc<dyn SnapshotAdmin>, ) -> Self
Construct a snapshot-only admin config (no WAL endpoints).
Trait Implementations§
Source§impl Clone for AdminConfig
impl Clone for AdminConfig
Auto Trait Implementations§
impl !RefUnwindSafe for AdminConfig
impl !UnwindSafe for AdminConfig
impl Freeze for AdminConfig
impl Send for AdminConfig
impl Sync for AdminConfig
impl Unpin for AdminConfig
impl UnsafeUnpin for AdminConfig
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
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> ⓘ
Converts
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> ⓘ
Converts
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