pub struct Relay(/* private fields */);
Implementations§
Source§impl Relay
impl Relay
Sourcepub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes using canonical CBOR encodings
Sourcepub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<Relay, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<Relay, JsError>
- Create this type from CBOR bytes
Sourcepub fn to_cbor_hex(&self) -> String
pub fn to_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes encoded as a hex string (useful for working with CIP30).
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_hex(&self) -> String
pub fn to_canonical_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes using canonical CBOR encodings as hex bytes
Source§impl Relay
impl Relay
pub fn new_single_host_addr( port: Option<Port>, ipv4: Option<Ipv4>, ipv6: Option<Ipv6>, ) -> Self
pub fn new_single_host_name(port: Option<Port>, dns_name: &DNSName) -> Self
pub fn new_multi_host_name(dns_name: &DNSName) -> Self
pub fn kind(&self) -> RelayKind
pub fn as_single_host_addr(&self) -> Option<SingleHostAddr>
pub fn as_single_host_name(&self) -> Option<SingleHostName>
pub fn as_multi_host_name(&self) -> Option<MultiHostName>
Trait Implementations§
Source§impl FromWasmAbi for Relay
impl FromWasmAbi for Relay
Source§impl IntoWasmAbi for Relay
impl IntoWasmAbi for Relay
Source§impl LongRefFromWasmAbi for Relay
impl LongRefFromWasmAbi for Relay
Source§impl OptionFromWasmAbi for Relay
impl OptionFromWasmAbi for Relay
Source§impl OptionIntoWasmAbi for Relay
impl OptionIntoWasmAbi for Relay
Source§impl RefFromWasmAbi for Relay
impl RefFromWasmAbi for Relay
Source§impl RefMutFromWasmAbi for Relay
impl RefMutFromWasmAbi for Relay
Source§impl TryFromJsValue for Relay
impl TryFromJsValue for Relay
Source§impl VectorFromWasmAbi for Relay
impl VectorFromWasmAbi for Relay
Source§impl VectorIntoWasmAbi for Relay
impl VectorIntoWasmAbi for Relay
impl SupportsConstructor for Relay
impl SupportsInstanceProperty for Relay
impl SupportsStaticProperty for Relay
Auto Trait Implementations§
impl Freeze for Relay
impl RefUnwindSafe for Relay
impl Send for Relay
impl Sync for Relay
impl Unpin for Relay
impl UnwindSafe for Relay
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.