Trait amqp0_parser_nom::pool::ParserPool
[−]
[src]
pub trait ParserPool { fn new_table_hashmap(&mut self,
usize)
-> HashMap<Cow<'static, str>, Value<'static>>; fn new_table_entries_vec(&mut self,
&[u8])
-> Vec<(&'static str, Value<'static>)>; fn new_values_vec(&mut self, &[u8]) -> Vec<Value<'static>>; fn return_table_hashmap(&mut self, _: HashMap<&'static str, &'static str>) { ... } fn return_table_entries_vec(&mut self,
_: Vec<(&'static str, Value<'static>)>) { ... } fn return_values_vec(&mut self, _: Vec<Value<'static>>) { ... } }
Creates the objects that may be needed for parsing
When parsing AMQP "fields", some values may require dynamic allocation-- at least the ones can't just reference into the byte-string (Table and List rather than &str or &[u8]).
Rather than allocate a new one each time, we let the user decide how to allocate these, based on the needed capacity.
Required Methods
fn new_table_hashmap(&mut self,
usize)
-> HashMap<Cow<'static, str>, Value<'static>>
usize)
-> HashMap<Cow<'static, str>, Value<'static>>
Given a capacity, returns a Table
fn new_table_entries_vec(&mut self,
&[u8])
-> Vec<(&'static str, Value<'static>)>
&[u8])
-> Vec<(&'static str, Value<'static>)>
Given the bytes for a table, returns a Vec to accept table entries Most likely to be used to assemble a table
fn new_values_vec(&mut self, &[u8]) -> Vec<Value<'static>>
Given a capacity, returns a vector for Vals Most likely to be used to assemble a List
Provided Methods
fn return_table_hashmap(&mut self, _: HashMap<&'static str, &'static str>)
fn return_table_entries_vec(&mut self, _: Vec<(&'static str, Value<'static>)>)
fn return_values_vec(&mut self, _: Vec<Value<'static>>)
Implementors
impl ParserPool for NoParserPool