pub struct Sentinel {
pub credential: CredentialName,
pub form: PresentationForm,
}Expand description
A typed placeholder marking exactly where material belongs in a request
whip constructs. The custodian substitutes at marked slots and nowhere
else. The textual form is {{whipplescript-credential:<name>:<form>}}.
This generalizes DR-0042’s fixed whipplescript-model-broker marker: the
sentinel names its handle and presentation form, so one request may carry
slots for several credentials.
Fields§
§credential: CredentialName§form: PresentationFormImplementations§
Source§impl Sentinel
impl Sentinel
pub fn new(credential: CredentialName, form: PresentationForm) -> Self
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
The textual slot marker embedded in headers/bodies whip constructs.
Sourcepub fn find_all(text: &str) -> Result<Vec<(Range<usize>, Sentinel)>, String>
pub fn find_all(text: &str) -> Result<Vec<(Range<usize>, Sentinel)>, String>
Every sentinel occurring in text, in order, with its byte range.
Malformed markers (an opener with no valid close/name/form) are
reported as errors rather than skipped: a slot the author believes is
marked but the custodian would not substitute is a silent
authentication failure at best.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sentinel
impl<'de> Deserialize<'de> for Sentinel
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 Sentinel
impl StructuralPartialEq for Sentinel
Auto Trait Implementations§
impl Freeze for Sentinel
impl RefUnwindSafe for Sentinel
impl Send for Sentinel
impl Sync for Sentinel
impl Unpin for Sentinel
impl UnsafeUnpin for Sentinel
impl UnwindSafe for Sentinel
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