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
Source§fn clone(&self) -> AdminConfig
fn clone(&self) -> AdminConfig
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 moreSource§impl Default for AdminConfig
impl Default for AdminConfig
Source§fn default() -> AdminConfig
fn default() -> AdminConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AdminConfig
impl !RefUnwindSafe for AdminConfig
impl Send for AdminConfig
impl Sync for AdminConfig
impl Unpin for AdminConfig
impl UnsafeUnpin for AdminConfig
impl !UnwindSafe 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