Struct alpaca::objects::Object
[−]
[src]
pub struct Object { pub kind: ObjectKind, pub content: Vec<u8>, pub position: Option<usize>, pub target_size: Option<usize>, }
An object to be used in the morphing process.
Fields
kind: ObjectKind
Type of the Object
content: Vec<u8>
Content (Vector of bytes) of the Object
position: Option<usize>
Position in the HTML body
target_size: Option<usize>
Size to pad the Object to
Methods
impl Object
[src]
pub fn from(raw: &[u8], request: &str) -> Object
[src]
Construct an Object given an array of bytes and the HTML request str
pub fn as_ptr(&self) -> *const u8
[src]
Returns a raw pointer to our Object's 'content' field's slice's buffer. "The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage."