pub struct MetadataSpec {
pub name: String,
pub json_path: Option<String>,
pub header: Option<String>,
pub regex: Option<String>,
pub group: Option<usize>,
}Expand description
Metadata extraction rule applied to a verification response.
§Examples
use keyhog_core::MetadataSpec;
let metadata = MetadataSpec {
name: "account_id".into(),
json_path: Some("data.id".into()),
header: None,
regex: None,
group: None,
};
assert_eq!(metadata.name, "account_id");Fields§
§name: StringOutput metadata key.
json_path: Option<String>JSON path to extract from the response body.
header: Option<String>Header name to extract when header capture is supported.
regex: Option<String>Optional regex applied to the extracted value.
group: Option<usize>Optional capture-group index for the metadata regex.
Trait Implementations§
Source§impl Clone for MetadataSpec
impl Clone for MetadataSpec
Source§fn clone(&self) -> MetadataSpec
fn clone(&self) -> MetadataSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataSpec
impl Debug for MetadataSpec
Source§impl<'de> Deserialize<'de> for MetadataSpec
impl<'de> Deserialize<'de> for MetadataSpec
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
Auto Trait Implementations§
impl Freeze for MetadataSpec
impl RefUnwindSafe for MetadataSpec
impl Send for MetadataSpec
impl Sync for MetadataSpec
impl Unpin for MetadataSpec
impl UnsafeUnpin for MetadataSpec
impl UnwindSafe for MetadataSpec
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more