Struct pact_plugin_driver::content::ContentGenerator
source · pub struct ContentGenerator {
pub catalogue_entry: CatalogueEntry,
}Expand description
Generator for contents based on content type
Fields§
§catalogue_entry: CatalogueEntryCatalogue entry for this content matcher
Implementations§
source§impl ContentGenerator
impl ContentGenerator
sourcepub fn catalogue_entry_key(&self) -> String
pub fn catalogue_entry_key(&self) -> String
Catalogue entry key for this generator
sourcepub fn plugin_name(&self) -> String
pub fn plugin_name(&self) -> String
Plugin name that provides this matcher
sourcepub async fn generate_content(
&self,
content_type: &ContentType,
generators: &HashMap<String, Generator>,
body: &OptionalBody,
plugin_data: &Vec<PluginData>,
interaction_data: &HashMap<String, HashMap<String, Value>>,
context: &HashMap<&str, Value>
) -> Result<OptionalBody>
pub async fn generate_content( &self, content_type: &ContentType, generators: &HashMap<String, Generator>, body: &OptionalBody, plugin_data: &Vec<PluginData>, interaction_data: &HashMap<String, HashMap<String, Value>>, context: &HashMap<&str, Value> ) -> Result<OptionalBody>
Generate the content for the given content type and body
Trait Implementations§
source§impl Clone for ContentGenerator
impl Clone for ContentGenerator
source§fn clone(&self) -> ContentGenerator
fn clone(&self) -> ContentGenerator
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for ContentGenerator
impl RefUnwindSafe for ContentGenerator
impl Send for ContentGenerator
impl Sync for ContentGenerator
impl Unpin for ContentGenerator
impl UnwindSafe for ContentGenerator
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> 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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request