#[non_exhaustive]pub struct WriteNoteRequest {
pub vault: String,
pub path: String,
pub content: String,
pub precondition: WritePrecondition,
pub commit_message: Option<String>,
pub provenance: Option<WriteProvenance>,
}Expand description
Safe full-note write request.
Construct with Self::new; the optional fields have builder setters. The
type is #[non_exhaustive] so the contract can gain fields without breaking
plugins that build requests through the constructor.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.vault: StringVault to write to.
Required, and checked by the host. TurboVault serves one active vault at a time and that selection can change between a plugin’s read and its write; naming the vault turns that race into a refusal instead of a write landing in the wrong vault.
path: StringVault-relative note path.
content: StringComplete replacement content.
precondition: WritePreconditionMandatory create-or-CAS condition; blind overwrites are not exposed.
commit_message: Option<String>Optional Git commit subject. Hosts may require it by policy.
provenance: Option<WriteProvenance>Optional best-effort writer identity for hook correlation.
This metadata is advisory and is not an authorization boundary. The host separately stamps the calling plugin’s namespace onto the event it publishes, and that stamp is the trustworthy one.
Implementations§
Source§impl WriteNoteRequest
impl WriteNoteRequest
Sourcepub fn new(
vault: impl Into<String>,
path: impl Into<String>,
content: impl Into<String>,
precondition: WritePrecondition,
) -> Self
pub fn new( vault: impl Into<String>, path: impl Into<String>, content: impl Into<String>, precondition: WritePrecondition, ) -> Self
Construct a write request for vault.
Sourcepub fn with_commit_message(self, message: impl Into<String>) -> Self
pub fn with_commit_message(self, message: impl Into<String>) -> Self
Set the Git commit subject.
Sourcepub fn with_provenance(self, provenance: WriteProvenance) -> Self
pub fn with_provenance(self, provenance: WriteProvenance) -> Self
Set advisory writer provenance.
Trait Implementations§
Source§impl Clone for WriteNoteRequest
impl Clone for WriteNoteRequest
Source§fn clone(&self) -> WriteNoteRequest
fn clone(&self) -> WriteNoteRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WriteNoteRequest
impl Debug for WriteNoteRequest
Source§impl<'de> Deserialize<'de> for WriteNoteRequest
impl<'de> Deserialize<'de> for WriteNoteRequest
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>,
impl Eq for WriteNoteRequest
Source§impl PartialEq for WriteNoteRequest
impl PartialEq for WriteNoteRequest
Source§impl Serialize for WriteNoteRequest
impl Serialize for WriteNoteRequest
impl StructuralPartialEq for WriteNoteRequest
Auto Trait Implementations§
impl Freeze for WriteNoteRequest
impl RefUnwindSafe for WriteNoteRequest
impl Send for WriteNoteRequest
impl Sync for WriteNoteRequest
impl Unpin for WriteNoteRequest
impl UnsafeUnpin for WriteNoteRequest
impl UnwindSafe for WriteNoteRequest
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
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
key and return true if they are equal.