pub struct Processor { /* private fields */ }Expand description
An instance of the ESI processor with a given configuration.
Implementations§
Source§impl Processor
impl Processor
pub const fn new( original_request_metadata: Option<Request>, configuration: Configuration, ) -> Self
Sourcepub fn process_response(
self,
src_document: &mut Response,
client_response_metadata: Option<Response>,
dispatch_fragment_request: Option<&dyn Fn(Request) -> Result<PendingFragmentContent>>,
process_fragment_response: Option<&dyn Fn(&mut Request, Response) -> Result<Response>>,
) -> Result<()>
pub fn process_response( self, src_document: &mut Response, client_response_metadata: Option<Response>, dispatch_fragment_request: Option<&dyn Fn(Request) -> Result<PendingFragmentContent>>, process_fragment_response: Option<&dyn Fn(&mut Request, Response) -> Result<Response>>, ) -> Result<()>
Process a response body as an ESI document. Consumes the response body.
Sourcepub fn process_parsed_document(
self,
src_events: VecDeque<Event<'_>>,
output_writer: &mut Writer<impl Write>,
dispatch_fragment_request: Option<&dyn Fn(Request) -> Result<PendingFragmentContent>>,
process_fragment_response: Option<&dyn Fn(&mut Request, Response) -> Result<Response>>,
) -> Result<()>
pub fn process_parsed_document( self, src_events: VecDeque<Event<'_>>, output_writer: &mut Writer<impl Write>, dispatch_fragment_request: Option<&dyn Fn(Request) -> Result<PendingFragmentContent>>, process_fragment_response: Option<&dyn Fn(&mut Request, Response) -> Result<Response>>, ) -> Result<()>
Process an ESI document that has already been parsed into a queue of events.
Sourcepub fn process_document(
self,
src_document: Reader<impl BufRead>,
output_writer: &mut Writer<impl Write>,
dispatch_fragment_request: Option<&dyn Fn(Request) -> Result<PendingFragmentContent>>,
process_fragment_response: Option<&dyn Fn(&mut Request, Response) -> Result<Response>>,
) -> Result<()>
pub fn process_document( self, src_document: Reader<impl BufRead>, output_writer: &mut Writer<impl Write>, dispatch_fragment_request: Option<&dyn Fn(Request) -> Result<PendingFragmentContent>>, process_fragment_response: Option<&dyn Fn(&mut Request, Response) -> Result<Response>>, ) -> Result<()>
Process an ESI document from a quick_xml::Reader.
Auto Trait Implementations§
impl !Freeze for Processor
impl !RefUnwindSafe for Processor
impl !Send for Processor
impl !Sync for Processor
impl Unpin for Processor
impl !UnwindSafe for Processor
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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