pub struct InitialStateEvent<C>where
C: StaticStateEventContent,{
pub content: C,
pub state_key: <C as StateEventContent>::StateKey,
}
Expand description
A minimal state event, used for creating a new room.
Fields§
§content: C
Data specific to the event type.
state_key: <C as StateEventContent>::StateKey
A unique key which defines the overwriting semantics for this piece of room state.
This is often an empty string, but some events send a UserId
to show which user the event
affects.
Defaults to the empty string.
Implementations§
Source§impl<C> InitialStateEvent<C>where
C: StaticStateEventContent,
impl<C> InitialStateEvent<C>where
C: StaticStateEventContent,
Sourcepub fn new(content: C) -> InitialStateEvent<C>where
C: StaticStateEventContent<StateKey = EmptyStateKey>,
pub fn new(content: C) -> InitialStateEvent<C>where
C: StaticStateEventContent<StateKey = EmptyStateKey>,
Create a new InitialStateEvent
for an event type with an empty state key.
For cases where the state key is not empty, use a struct literal to create the event.
Sourcepub fn to_raw(&self) -> Raw<InitialStateEvent<C>>
pub fn to_raw(&self) -> Raw<InitialStateEvent<C>>
Shorthand for Raw::new(self).unwrap()
.
Since none of the content types in Ruma ever return an error in serialization, this will
never panic with C
being a type from Ruma. However, if you use a custom content type
with a Serialize
implementation that can error (for example because it contains an
enum
with one or more variants that use the #[serde(skip)]
attribute), this method
can panic.
Sourcepub fn to_raw_any(&self) -> Raw<AnyInitialStateEvent>
pub fn to_raw_any(&self) -> Raw<AnyInitialStateEvent>
Shorthand for self.to_raw().cast::<AnyInitialStateEvent>()
.
Since none of the content types in Ruma ever return an error in serialization, this will
never panic with C
being a type from Ruma. However, if you use a custom content type
with a Serialize
implementation that can error (for example because it contains an
enum
with one or more variants that use the #[serde(skip)]
attribute), this method
can panic.
Trait Implementations§
Source§impl<C> Clone for InitialStateEvent<C>
impl<C> Clone for InitialStateEvent<C>
Source§fn clone(&self) -> InitialStateEvent<C>
fn clone(&self) -> InitialStateEvent<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<C> Debug for InitialStateEvent<C>
impl<C> Debug for InitialStateEvent<C>
Source§impl<C> Default for InitialStateEvent<C>
impl<C> Default for InitialStateEvent<C>
Source§fn default() -> InitialStateEvent<C>
fn default() -> InitialStateEvent<C>
Source§impl<'de, C> Deserialize<'de> for InitialStateEvent<C>where
C: StaticStateEventContent + EventContentFromType,
impl<'de, C> Deserialize<'de> for InitialStateEvent<C>where
C: StaticStateEventContent + EventContentFromType,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<InitialStateEvent<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<InitialStateEvent<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl From<InitialStateEvent<BeaconInfoEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<BeaconInfoEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<BeaconInfoEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<BeaconInfoEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<CallMemberEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<CallMemberEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<CallMemberEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<CallMemberEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<MemberHintsEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<MemberHintsEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<MemberHintsEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<MemberHintsEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<PolicyRuleRoomEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<PolicyRuleRoomEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<PolicyRuleRoomEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<PolicyRuleRoomEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<PolicyRuleServerEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<PolicyRuleServerEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<PolicyRuleServerEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<PolicyRuleServerEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<PolicyRuleUserEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<PolicyRuleUserEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<PolicyRuleUserEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<PolicyRuleUserEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomAliasesEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomAliasesEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomAliasesEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomAliasesEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomAvatarEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomAvatarEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomAvatarEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomAvatarEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomCanonicalAliasEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomCanonicalAliasEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomCanonicalAliasEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomCanonicalAliasEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomCreateEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomCreateEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomCreateEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomCreateEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomEncryptionEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomEncryptionEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomEncryptionEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomEncryptionEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomGuestAccessEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomGuestAccessEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomGuestAccessEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomGuestAccessEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomHistoryVisibilityEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomHistoryVisibilityEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomHistoryVisibilityEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomHistoryVisibilityEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomJoinRulesEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomJoinRulesEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomJoinRulesEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomJoinRulesEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomMemberEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomMemberEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomMemberEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomMemberEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomNameEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomNameEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomNameEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomNameEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomPinnedEventsEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomPinnedEventsEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomPinnedEventsEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomPinnedEventsEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomPowerLevelsEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomPowerLevelsEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomPowerLevelsEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomPowerLevelsEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomServerAclEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomServerAclEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomServerAclEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomServerAclEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomThirdPartyInviteEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomThirdPartyInviteEventContent>> for AnyInitialStateEvent
Source§fn from(
c: InitialStateEvent<RoomThirdPartyInviteEventContent>,
) -> AnyInitialStateEvent
fn from( c: InitialStateEvent<RoomThirdPartyInviteEventContent>, ) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomTombstoneEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomTombstoneEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomTombstoneEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomTombstoneEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<RoomTopicEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<RoomTopicEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<RoomTopicEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<RoomTopicEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<SpaceChildEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<SpaceChildEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<SpaceChildEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<SpaceChildEventContent>) -> AnyInitialStateEvent
Source§impl From<InitialStateEvent<SpaceParentEventContent>> for AnyInitialStateEvent
impl From<InitialStateEvent<SpaceParentEventContent>> for AnyInitialStateEvent
Source§fn from(c: InitialStateEvent<SpaceParentEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<SpaceParentEventContent>) -> AnyInitialStateEvent
Source§impl<C> Serialize for InitialStateEvent<C>where
C: StaticStateEventContent,
impl<C> Serialize for InitialStateEvent<C>where
C: StaticStateEventContent,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl<C> Freeze for InitialStateEvent<C>
impl<C> RefUnwindSafe for InitialStateEvent<C>
impl<C> Send for InitialStateEvent<C>
impl<C> Sync for InitialStateEvent<C>
impl<C> Unpin for InitialStateEvent<C>
impl<C> UnwindSafe for InitialStateEvent<C>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more