pub struct Change { /* private fields */ }Expand description
A requested edit: set the field at path to value.
Deserialises from {"path": "...", "value": ...}, the shape of each entry
in the HTTP changes array. The path is checked by preview, not here.
§Serialisation and redaction
Serialize writes the same shape back with the value verbatim, a
secret reference included, so a request round-trips unchanged. Debug
redacts the value of a secret-reference field to REDACTED, so a
change can be logged with {:?}. Do not log or persist the serialised
form where secret references must not appear; build a FieldChange
list through preview instead, which is redacted. A reference names a
secret held by a custody service and is not the secret itself, but it
still tells a reader where to look, so it stays out of logs by default.
§Examples
use stratum_node_config::Change;
let change = Change::new("limits.max_body_bytes", 65_536);
assert_eq!(change.path(), "limits.max_body_bytes");Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Change
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Forget for Change
impl Freeze for Change
impl Move for Change
impl RefUnwindSafe for Change
impl Send for Changewhere
RawVecInner: Send,
impl Sync for Changewhere
RawVecInner: Sync,
impl Unpin for Change
impl UnsafeUnpin for Changewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Changewhere
RawVecInner: UnwindSafe,
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.