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

Type of the Object

Content (Vector of bytes) of the Object

Position in the HTML body

Size to pad the Object to

Methods

impl Object
[src]

[src]

Construct an Object given an array of bytes and the HTML request str

[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."

Trait Implementations

impl Paddable for Object
[src]

[src]

Pads an object up to a given size.

Padding varies with respect to the object's type. In HTML and CSS objects, padding is added within a comment. In other (binary) objects it is done by appending random bytes.

Arguments

  • target_size - The target size.