[−][src]Struct enr::EnrBuilder
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,
K: RefUnwindSafe,
impl<K> Send for EnrBuilder<K> where
K: Send,
K: Send,
impl<K> Sync for EnrBuilder<K> where
K: Sync,
K: Sync,
impl<K> Unpin for EnrBuilder<K> where
K: Unpin,
K: Unpin,
impl<K> UnwindSafe for EnrBuilder<K> where
K: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,