Struct matrix_sdk_base::ruma::events::InitialStateEvent
source · 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
Available on crate feature unstable-msc3489
only.
impl From<InitialStateEvent<BeaconInfoEventContent>> for AnyInitialStateEvent
unstable-msc3489
only.source§fn from(c: InitialStateEvent<BeaconInfoEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<BeaconInfoEventContent>) -> AnyInitialStateEvent
source§impl From<InitialStateEvent<CallMemberEventContent>> for AnyInitialStateEvent
Available on crate feature unstable-msc3401
only.
impl From<InitialStateEvent<CallMemberEventContent>> for AnyInitialStateEvent
unstable-msc3401
only.source§fn from(c: InitialStateEvent<CallMemberEventContent>) -> AnyInitialStateEvent
fn from(c: InitialStateEvent<CallMemberEventContent>) -> 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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