pub enum ReadOnlyProbe {
Once,
Always,
}Expand description
How often the destination is asked whether it accepts a change.
The answer cannot change while one connection is open, so asking once and keeping the answer is the honest reading and costs nothing. A caller who distrusts that, because the destination may be promoted or demoted while a file of statements is running, asks for it to be consulted before every change and pays for it.
Neither value keeps anything across invocations. Nothing survives this process, so there is nothing to carry over even if it were wanted.
Variants§
Once
Asked before the first change, and that answer serves the rest.
Always
Asked again before every change.
Implementations§
Source§impl ReadOnlyProbe
impl ReadOnlyProbe
Sourcepub fn parse(word: &str) -> Result<Self>
pub fn parse(word: &str) -> Result<Self>
Reads the frequency from the word stored under server.readonly_probe.
There is no fallback branch on purpose. The registry is the one place the default of that key lives, and a fallback here would be a second one, silently winning wherever the two disagreed.
§Errors
Returns a configuration failure when the word is outside the domain the registry publishes for that key.
Sourcepub const fn asks_every_time(self) -> bool
pub const fn asks_every_time(self) -> bool
Whether the kept answer is discarded before each change.
Trait Implementations§
Source§impl Clone for ReadOnlyProbe
impl Clone for ReadOnlyProbe
impl Copy for ReadOnlyProbe
Source§impl Debug for ReadOnlyProbe
impl Debug for ReadOnlyProbe
Source§impl Default for ReadOnlyProbe
impl Default for ReadOnlyProbe
impl Eq for ReadOnlyProbe
Source§impl PartialEq for ReadOnlyProbe
impl PartialEq for ReadOnlyProbe
impl StructuralPartialEq for ReadOnlyProbe
Auto Trait Implementations§
impl Freeze for ReadOnlyProbe
impl RefUnwindSafe for ReadOnlyProbe
impl Send for ReadOnlyProbe
impl Sync for ReadOnlyProbe
impl Unpin for ReadOnlyProbe
impl UnsafeUnpin for ReadOnlyProbe
impl UnwindSafe for ReadOnlyProbe
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.