pub struct ModificationResponse { /* private fields */ }
Expand description
A container for multiple modification requests towards the milter client.
use miltr_common::modifications::{ModificationResponse, headers::AddHeader};
let mut builder = ModificationResponse::builder();
builder.push(AddHeader::new(
"Test Add Header".as_bytes(),
"Add Header Value".as_bytes(),
));
let response = builder.contin();
§Note on Capabilities
While all ModificationAction
can be pushed into this response,
they might not all be sent.
During option negotiation, client and server agree on supported
Capability
.
Implementations§
Source§impl ModificationResponse
impl ModificationResponse
Sourcepub fn builder() -> ModificationResponseBuilder
pub fn builder() -> ModificationResponseBuilder
Create a builder to assemble a modification response.
Sourcepub fn empty_continue() -> Self
pub fn empty_continue() -> Self
Create an empty ModificationResponse
just to continue
Sourcepub fn filter_mods_by_caps(&mut self, capabilities: Capability)
pub fn filter_mods_by_caps(&mut self, capabilities: Capability)
Filter modification actions in self
, keep only those which have been
allowed by the specified capabilities
.
Sourcepub fn modifications(&self) -> &[ModificationAction]
pub fn modifications(&self) -> &[ModificationAction]
Get the received modification actions
Sourcepub fn final_action(&self) -> &Action
pub fn final_action(&self) -> &Action
Get the final action to be done to the mail
Trait Implementations§
Source§impl Debug for ModificationResponse
impl Debug for ModificationResponse
Source§impl From<ModificationResponse> for Vec<ServerMessage>
impl From<ModificationResponse> for Vec<ServerMessage>
Source§fn from(value: ModificationResponse) -> Self
fn from(value: ModificationResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ModificationResponse
impl RefUnwindSafe for ModificationResponse
impl Send for ModificationResponse
impl Sync for ModificationResponse
impl Unpin for ModificationResponse
impl UnwindSafe for ModificationResponse
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