Struct bip_dht::message::response::ResponseValidate
[−]
[src]
pub struct ResponseValidate<'a> { /* fields omitted */ }
Methods
impl<'a> ResponseValidate<'a>
[src]
fn new(trans_id: &'a [u8]) -> ResponseValidate<'a>
fn validate_node_id(&self, node_id: &[u8]) -> Result<NodeId, DhtError>
fn validate_nodes<'b>(
&self,
nodes: &'b [u8]
) -> Result<CompactNodeInfo<'b>, DhtError>
&self,
nodes: &'b [u8]
) -> Result<CompactNodeInfo<'b>, DhtError>
Validate the given nodes string which should be IPv4 compact
fn validate_values<'b>(
&self,
values: &'b [Bencode<'a>]
) -> Result<CompactValueInfo<'b>, DhtError>
&self,
values: &'b [Bencode<'a>]
) -> Result<CompactValueInfo<'b>, DhtError>
Trait Implementations
impl<'a> BencodeConvert for ResponseValidate<'a>
[src]
type Error = DhtError
fn handle_error(&self, error: BencodeConvertError) -> DhtError
Convert the given conversion error into the appropriate error type.
fn convert_int(
&self,
bencode: &Bencode<'a>,
error_key: &str
) -> Result<i64, Self::Error>
&self,
bencode: &Bencode<'a>,
error_key: &str
) -> Result<i64, Self::Error>
Attempt to convert the given bencode value into an integer. Read more
fn convert_bytes(
&self,
bencode: &Bencode<'a>,
error_key: &str
) -> Result<&'a [u8], Self::Error>
&self,
bencode: &Bencode<'a>,
error_key: &str
) -> Result<&'a [u8], Self::Error>
Attempt to convert the given bencode value into bytes. Read more
fn convert_str(
&self,
bencode: &Bencode<'a>,
error_key: &str
) -> Result<&'a str, Self::Error>
&self,
bencode: &Bencode<'a>,
error_key: &str
) -> Result<&'a str, Self::Error>
Attempt to convert the given bencode value into a UTF-8 string. Read more
fn convert_list(
&self,
bencode: &'b Bencode<'a>,
error_key: &str
) -> Result<&'b [Bencode<'a>], Self::Error>
&self,
bencode: &'b Bencode<'a>,
error_key: &str
) -> Result<&'b [Bencode<'a>], Self::Error>
Attempty to convert the given bencode value into a list. Read more
fn convert_dict(
&self,
bencode: &'b Bencode<'a>,
error_key: &str
) -> Result<&'b Dictionary<'a, Bencode<'a>> + 'b, Self::Error>
&self,
bencode: &'b Bencode<'a>,
error_key: &str
) -> Result<&'b Dictionary<'a, Bencode<'a>> + 'b, Self::Error>
Attempt to convert the given bencode value into a dictionary. Read more
fn lookup(
&self,
dictionary: &'b Dictionary<'a, Bencode<'a>> + 'b,
key: &str
) -> Result<&'b Bencode<'a>, Self::Error>
&self,
dictionary: &'b Dictionary<'a, Bencode<'a>> + 'b,
key: &str
) -> Result<&'b Bencode<'a>, Self::Error>
Look up a value in a dictionary of bencoded values using the given key.
fn lookup_and_convert_int(
&self,
dictionary: &Dictionary<'a, Bencode<'a>>,
key: &str
) -> Result<i64, Self::Error>
&self,
dictionary: &Dictionary<'a, Bencode<'a>>,
key: &str
) -> Result<i64, Self::Error>
Combines a lookup operation on the given key with a conversion of the value, if found, to an integer.
fn lookup_and_convert_bytes(
&self,
dictionary: &Dictionary<'a, Bencode<'a>>,
key: &str
) -> Result<&'a [u8], Self::Error>
&self,
dictionary: &Dictionary<'a, Bencode<'a>>,
key: &str
) -> Result<&'a [u8], Self::Error>
Combines a lookup operation on the given key with a conversion of the value, if found, to a series of bytes.
fn lookup_and_convert_str(
&self,
dictionary: &Dictionary<'a, Bencode<'a>>,
key: &str
) -> Result<&'a str, Self::Error>
&self,
dictionary: &Dictionary<'a, Bencode<'a>>,
key: &str
) -> Result<&'a str, Self::Error>
Combines a lookup operation on the given key with a conversion of the value, if found, to a UTF-8 string.
fn lookup_and_convert_list<'a, 'b>(
&self,
dictionary: &'b Dictionary<'a, Bencode<'a>> + 'b,
key: &str
) -> Result<&'b [Bencode<'a>], Self::Error> where
'a: 'b,
&self,
dictionary: &'b Dictionary<'a, Bencode<'a>> + 'b,
key: &str
) -> Result<&'b [Bencode<'a>], Self::Error> where
'a: 'b,
Combines a lookup operation on the given key with a conversion of the value, if found, to a list.
fn lookup_and_convert_dict<'a, 'b>(
&self,
dictionary: &'b Dictionary<'a, Bencode<'a>> + 'b,
key: &str
) -> Result<&'b Dictionary<'a, Bencode<'a>> + 'b, Self::Error> where
'a: 'b,
&self,
dictionary: &'b Dictionary<'a, Bencode<'a>> + 'b,
key: &str
) -> Result<&'b Dictionary<'a, Bencode<'a>> + 'b, Self::Error> where
'a: 'b,
Combines a lookup operation on the given key with a conversion of the value, if found, to a dictionary.