[][src]Struct enr::EnrBuilder

pub struct EnrBuilder<K: EnrKey> { /* fields omitted */ }

The base builder for generating ENR records with arbitrary signing algorithms.

Implementations

impl<K: EnrKey> EnrBuilder<K>[src]

pub fn new(id: impl Into<String>) -> Self[src]

Constructs a minimal EnrBuilder providing only a sequence number. Currently only supports the id v4 scheme and therefore disallows creation of any other scheme.

pub fn seq(&mut self, seq: u64) -> &mut Self[src]

Modifies the sequence number of the builder.

pub fn add_value(&mut self, key: String, value: Vec<u8>) -> &mut Self[src]

Adds an arbitrary key-value to the ENRBuilder.

pub fn ip(&mut self, ip: IpAddr) -> &mut Self[src]

Adds an ip field to the ENRBuilder.

pub fn tcp(&mut self, tcp: u16) -> &mut Self[src]

Adds a tcp field to the ENRBuilder.

pub fn tcp6(&mut self, tcp: u16) -> &mut Self[src]

Adds a tcp6 field to the ENRBuilder.

pub fn udp(&mut self, udp: u16) -> &mut Self[src]

Adds a udp field to the ENRBuilder.

pub fn udp6(&mut self, udp: u16) -> &mut Self[src]

Adds a udp6 field to the ENRBuilder.

pub fn build(&mut self, key: &K) -> Result<Enr<K>, EnrError>[src]

Constructs an ENR from the EnrBuilder.

Errors

Fails if the identity scheme is not supported, or the record size exceeds MAX_ENR_SIZE.

Auto Trait Implementations

impl<K> RefUnwindSafe for EnrBuilder<K> where
    K: RefUnwindSafe

impl<K> Send for EnrBuilder<K> where
    K: Send

impl<K> Sync for EnrBuilder<K> where
    K: Sync

impl<K> Unpin for EnrBuilder<K> where
    K: Unpin

impl<K> UnwindSafe for EnrBuilder<K> where
    K: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,