pub struct RawBuilder { /* private fields */ }Expand description
Builder for constructing Raw layer payloads.
The builder supports multiple ways to specify payload data:
- Raw bytes via
load() - String content via
from_str() - Hex-encoded data via
from_hex() - Repeated patterns via
repeat()
Implementations§
Source§impl RawBuilder
impl RawBuilder
Sourcepub fn with_bytes(data: Vec<u8>) -> Self
pub fn with_bytes(data: Vec<u8>) -> Self
Create a RawBuilder with the given bytes.
Sourcepub fn from_hex(hex: &str) -> Option<Self>
pub fn from_hex(hex: &str) -> Option<Self>
Create a RawBuilder from a hex string (e.g., “deadbeef”).
Returns None if the hex string is invalid or contains no valid hex digits.
Sourcepub fn append_str(self, s: &str) -> Self
pub fn append_str(self, s: &str) -> Self
Append a string to the payload.
Sourcepub fn repeat(self, byte: u8, count: usize) -> Self
pub fn repeat(self, byte: u8, count: usize) -> Self
Create a payload of count repeated byte values.
Sourcepub fn pattern(self, pattern: &[u8], len: usize) -> Self
pub fn pattern(self, pattern: &[u8], len: usize) -> Self
Create a payload filled with a pattern repeated to reach len bytes.
Trait Implementations§
Source§impl Clone for RawBuilder
impl Clone for RawBuilder
Source§fn clone(&self) -> RawBuilder
fn clone(&self) -> RawBuilder
Returns a duplicate 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 moreSource§impl Debug for RawBuilder
impl Debug for RawBuilder
Source§impl Default for RawBuilder
impl Default for RawBuilder
Source§fn default() -> RawBuilder
fn default() -> RawBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RawBuilder
impl RefUnwindSafe for RawBuilder
impl Send for RawBuilder
impl Sync for RawBuilder
impl Unpin for RawBuilder
impl UnsafeUnpin for RawBuilder
impl UnwindSafe for RawBuilder
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