Skip to main content

Type

Trait Type 

Source
pub trait Type {
    const TYPE: &'static Type<'static>;
}
Expand description

Type introspection.

This trait provides type metadata for Rust types, mapping them to their corresponding IDL representation. Implementing this trait allows a type to participate in Varlink’s type introspection system.

§Usage

For custom types, use the Type derive macro:

use zlink::introspect::Type;

#[derive(Type)]
struct MyRequest {
    id: String,
    count: i32,
}

The derive macro automatically generates the appropriate Type implementation based on your struct’s fields.

Required Associated Constants§

Source

const TYPE: &'static Type<'static>

The type information.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Type for &str

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for ()

Unit type maps to an empty object in Varlink.

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for Duration

Core Duration - available in no-std.

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for Instant

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl Type for IpAddr

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for Ipv4Addr

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for Ipv6Addr

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for OsStr

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl Type for OsString

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl Type for Path

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl Type for PathBuf

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl Type for SocketAddr

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for SocketAddrV4

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for SocketAddrV6

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for String

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for SystemTime

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl Type for Value

serde_json::Value represents a foreign (untyped) object.

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for bool

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for char

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for f32

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for f64

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for i8

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for i16

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for i32

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for i64

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for isize

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for str

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for u8

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for u16

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for u32

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for u64

Source§

const TYPE: &'static Type<'static>

Source§

impl Type for usize

Source§

const TYPE: &'static Type<'static>

Source§

impl<T> Type for &[T]
where T: Type,

Slice implementation.

Source§

const TYPE: &'static Type<'static>

Source§

impl<T> Type for Arc<T>
where T: Type + ?Sized,

Source§

const TYPE: &'static Type<'static> = T::TYPE

Source§

impl<T> Type for BTreeSet<T>
where T: Type,

Source§

const TYPE: &'static Type<'static>

Source§

impl<T> Type for Box<T>
where T: Type + ?Sized,

Source§

const TYPE: &'static Type<'static> = T::TYPE

Source§

impl<T> Type for Cell<T>
where T: Type + ?Sized,

Source§

const TYPE: &'static Type<'static> = T::TYPE

Source§

impl<T> Type for Cow<'_, T>
where T: Type + ToOwned + ?Sized,

Source§

const TYPE: &'static Type<'static> = T::TYPE

Source§

impl<T> Type for HashSet<T>
where T: Type,

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl<T> Type for Option<T>
where T: Type,

Source§

const TYPE: &'static Type<'static>

Source§

impl<T> Type for Rc<T>
where T: Type + ?Sized,

Source§

const TYPE: &'static Type<'static> = T::TYPE

Source§

impl<T> Type for RefCell<T>
where T: Type + ?Sized,

Source§

const TYPE: &'static Type<'static> = T::TYPE

Source§

impl<T> Type for Vec<T>
where T: Type,

Standard Vec implementation.

Source§

const TYPE: &'static Type<'static>

Source§

impl<V> Type for BTreeMap<&str, V>
where V: Type,

Source§

const TYPE: &'static Type<'static>

Source§

impl<V> Type for BTreeMap<String, V>
where V: Type,

Source§

const TYPE: &'static Type<'static>

Source§

impl<V> Type for HashMap<&str, V>
where V: Type,

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Source§

impl<V> Type for HashMap<String, V>
where V: Type,

Available on crate feature std only.
Source§

const TYPE: &'static Type<'static>

Implementors§

Source§

impl<'a> Type for Info<'a>

Source§

const TYPE: &'static Type<'static>

Source§

impl<'a> Type for InterfaceDescription<'a>

Source§

const TYPE: &'static Type<'static>