Struct sonic_channel::ControlChannel
source · [−]pub struct ControlChannel(_);
Expand description
The Sonic Channel Control mode is used for administration purposes. Once in this mode, you cannot switch to other modes or gain access to commands from other modes.
Available commands
In this mode you can use consolidate
, backup
, restore
,
ping
and quit
commands.
Note: This mode requires enabling the control
feature.
Implementations
sourceimpl ControlChannel
impl ControlChannel
sourceimpl ControlChannel
impl ControlChannel
sourcepub fn trigger(
&self,
req: TriggerRequest<'_>
) -> Result<<TriggerCommand<'_> as StreamCommand>::Response>
pub fn trigger(
&self,
req: TriggerRequest<'_>
) -> Result<<TriggerCommand<'_> as StreamCommand>::Response>
Trigger control action.
Note: This method requires enabling the control
feature and start connection in
Control mode
let control_channel = ControlChannel::start(
"localhost:1491",
"SecretPassword",
)?;
control_channel.trigger(TriggerRequest::Consolidate)?;
sourcepub fn consolidate(&self) -> Result<()>
pub fn consolidate(&self) -> Result<()>
Consolidate indexed search data instead of waiting for the next automated consolidation tick.
Note: This method requires enabling the control
feature and start
connection in Control mode.
let control_channel = ControlChannel::start(
"localhost:1491",
"SecretPassword",
)?;
control_channel.consolidate()?;
sourcepub fn backup(&self, path: &str) -> Result<()>
pub fn backup(&self, path: &str) -> Result<()>
Backup KV + FST to
Note: This method requires enabling the control
feature and start
connection in Control mode.
let control_channel = ControlChannel::start(
"localhost:1491",
"SecretPassword",
)?;
control_channel.backup("2020-08-07T23-48")?;
sourcepub fn restore(&self, path: &str) -> Result<()>
pub fn restore(&self, path: &str) -> Result<()>
Restore KV + FST from
Note: This method requires enabling the control
feature and start
connection in Control mode.
let control_channel = ControlChannel::start(
"localhost:1491",
"SecretPassword",
)?;
let result = control_channel.restore("2020-08-07T23-48")?;
assert_eq!(result, ());