pub struct Policy {
pub type: Option<String>,
pub rule: Option<Vec<u8>>,
pub action: Option<i32>,
pub match: Option<i32>,
pub value: Option<Vec<u8>>,
}Expand description
Policy: information about any name server operator policy applied to the processing of a DNS message.
Fields§
§type: Option<String>type: the type of policy applied, e.g. “RPZ” for a policy from a Response Policy Zone.
rule: Option<Vec<u8>>rule: the rule matched by the message.
In a RPZ context, this is the owner name of the rule in the Reponse Policy Zone in wire format.
action: Option<i32>action: the policy action taken in response to the rule match.
match: Option<i32>match: the feature of the message exchange which matched the rule.
value: Option<Vec<u8>>The matched value. Format depends on the matched feature .
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn rule(&self) -> &[u8] ⓘ
pub fn rule(&self) -> &[u8] ⓘ
Returns the value of rule, or the default value if rule is unset.
Sourcepub fn action(&self) -> Action
pub fn action(&self) -> Action
Returns the enum value of action, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_action(&mut self, value: Action)
pub fn set_action(&mut self, value: Action)
Sets action to the provided enum value.
Trait Implementations§
Source§impl Message for Policy
impl Message for Policy
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
Source§fn octets_into(self) -> Result<Target, ShortBuf>
fn octets_into(self) -> Result<Target, ShortBuf>
Performs the conversion.