[][src]Struct lightning_invoice::Route

pub struct Route(_);

Private routing information

Invariants

The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)

Methods

impl Route
[src]

pub fn new(hops: Vec<RouteHop>) -> Result<Route, CreationError>
[src]

Create a new (partial) route from a list of hops

pub fn into_inner(self) -> Vec<RouteHop>
[src]

Returrn the underlying vector of hops

Methods from Deref<Target = Vec<RouteHop>>

pub fn capacity(&self) -> usize
1.0.0
[src]

Returns the number of elements the vector can hold without reallocating.

Examples

let vec: Vec<i32> = Vec::with_capacity(10);
assert_eq!(vec.capacity(), 10);

pub fn as_slice(&self) -> &[T]
1.7.0
[src]

Extracts a slice containing the entire vector.

Equivalent to &s[..].

Examples

use std::io::{self, Write};
let buffer = vec![1, 2, 3, 5, 8];
io::sink().write(buffer.as_slice()).unwrap();

pub fn len(&self) -> usize
1.0.0
[src]

Returns the number of elements in the vector, also referred to as its 'length'.

Examples

let a = vec![1, 2, 3];
assert_eq!(a.len(), 3);

pub fn is_empty(&self) -> bool
1.0.0
[src]

Returns true if the vector contains no elements.

Examples

let mut v = Vec::new();
assert!(v.is_empty());

v.push(1);
assert!(!v.is_empty());

Trait Implementations

impl Clone for Route
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Route
[src]

impl Into<Vec<RouteHop>> for Route
[src]

impl PartialEq<Route> for Route
[src]

impl Debug for Route
[src]

impl Deref for Route
[src]

type Target = Vec<RouteHop>

The resulting type after dereferencing.

impl FromBase32 for Route
[src]

type Err = ParseError

The associated error which can be returned from parsing (e.g. because of bad padding).

impl ToBase32<Vec<u5>> for Route
[src]

Auto Trait Implementations

impl Send for Route

impl Sync for Route

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToBase32 for T where
    T: AsRef<[u8]>, 
[src]

fn to_base32(&self) -> Vec<u5>
[src]

Convert base256 to base32, adds padding if necessary