pub struct Batch<'a> { /* private fields */ }Expand description
Batch manages nftables objects and is used to prepare an nftables payload.
Implementations§
Source§impl<'a> Batch<'a>
impl<'a> Batch<'a>
Sourcepub fn add(&mut self, obj: NfListObject<'a>)
pub fn add(&mut self, obj: NfListObject<'a>)
Adds object with add command to Batch.
Sourcepub fn delete(&mut self, obj: NfListObject<'a>)
pub fn delete(&mut self, obj: NfListObject<'a>)
Adds object with delete command to Batch.
Sourcepub fn add_obj(&mut self, obj: NfListObject<'a>)
pub fn add_obj(&mut self, obj: NfListObject<'a>)
Adds a list object (without a command) directly to Batch.
This corresponds to the descriptive output format of nft -j list ruleset.
Sourcepub fn add_all<I: IntoIterator<Item = NfObject<'a>>>(&mut self, objs: I)
pub fn add_all<I: IntoIterator<Item = NfObject<'a>>>(&mut self, objs: I)
Adds all given objects to the batch.
Sourcepub fn to_nftables(self) -> Nftables<'a>
pub fn to_nftables(self) -> Nftables<'a>
Wraps Batch in nftables object.
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Batch<'a>
impl<'de, 'a> Deserialize<'de> for Batch<'a>
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
impl<'a> Eq for Batch<'a>
impl<'a> StructuralPartialEq for Batch<'a>
Auto Trait Implementations§
impl<'a> Freeze for Batch<'a>
impl<'a> RefUnwindSafe for Batch<'a>
impl<'a> Send for Batch<'a>
impl<'a> Sync for Batch<'a>
impl<'a> Unpin for Batch<'a>
impl<'a> UnsafeUnpin for Batch<'a>
impl<'a> UnwindSafe for Batch<'a>
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