Struct BinaryCookiesReader

Source
pub struct BinaryCookiesReader { /* private fields */ }

Implementations§

Source§

impl BinaryCookiesReader

Source

pub fn new(target: &String) -> Result<Self, BinaryCookieError>

§BinaryCookiesReader - new

need a .binarycookies file path to build, return a BinaryCookiesReader

§Arguments
  • target - type is String, .binarycookies file path
§Returns

Result<(), BinaryCookieError>

§Examples
let target_file_path: String = String::from("/Users/foo/Library/HTTPStorages/boo.binarycookies");
let mut bc_decoder = BinaryCookiesReader::new(&target_file_path).unwrap();
let _ = bc_decoder.decoder().unwrap();
for page in bc_decoder.origin_pages():
    for cookie in page.cookies():
        println!("{} | {} | {}", cookie.name_str(), cookie.value_str(), cookie.http_only)
Source

pub fn from_vec(target: &Vec<u8>) -> Self

§BinaryCookiesReader - from_vec

need a Vec data to build

§Arguments
  • target - type is Vec, after read_binary…
§Returns

BinaryCookiesReader

§Examples
use std::fs::File;

let target_file_path: String = String::from("/Users/foo/Library/HTTPStorages/boo.binarycookies");
let mut buf = Vec::new();
let mut f = File::open(&target_file_path);
let _ = f.read_to_end(&mut buf);
let mut bc_decoder = BinaryCookiesReader::from_vec(&buf).unwrap();
let _ = bc_decoder.decoder().unwrap();
for page in bc_decoder.origin_pages():
    for cookie in page.cookies():
        println!("{} | {} | {}", cookie.name_str(), cookie.value_str(), cookie.http_only)
Source

pub fn deocde(&mut self) -> Result<(), BinaryCookieError>

Source

pub fn origin_pages(&mut self) -> &Vec<Page>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.