pub trait StaticEventContent: Sized {
type IsPrefix: BooleanType;
const TYPE: &'static str;
}
events
only.Expand description
An event content type with a statically-known event type
value.
Note that the TYPE
might not be the full event type. If IsPrefix
is set to True
, it only
contains the statically-known prefix of the event type.
To only support full event types, the bound StaticEventContent<IsPrefix = False>
can be used.
Required Associated Constants§
Required Associated Types§
Sourcetype IsPrefix: BooleanType
type IsPrefix: BooleanType
Whether the statically-known part of the event type is the prefix.
Should be set to the True
or False
types.
Ideally this should be a boolean associated constant, but associated constant equality is unstable, so this field could not be used as a bound. Instead we use an associated type so we can rely on associated type equality.
If this is set to False
, the TYPE
is the full event type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.