Skip to main content

IntoTopic

Trait IntoTopic 

Source
pub trait IntoTopic {
    // Required method
    fn into_topic(&self) -> TopicSrc<'_>;
}
Expand description

Trait for types that can be converted into an event topic.

u32, u64, u128 and U256 use zero-extended, 32-byte big-endian encoding. i32, i64, i128 and I256 use sign-extended, 32-byte big-endian encoding. bool uses the same representation for 0 or 1. Other primitive integer types are not supported as topics. Byte arrays of length 32, addresses and hashes borrow their bytes directly. Strings and byte slices are always XDR-encoded and SHA-256 hashed.

Required Methods§

Source

fn into_topic(&self) -> TopicSrc<'_>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoTopic for [u8; 32]

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for [u8]

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for bool

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for i32

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for i64

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for i128

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for str

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for u32

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for u64

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl IntoTopic for u128

Source§

fn into_topic(&self) -> TopicSrc<'_>

Source§

impl<T: IntoTopic + ?Sized> IntoTopic for &T

Source§

fn into_topic(&self) -> TopicSrc<'_>

Implementors§