MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / is_init

Method is_init

event/src/unvalidated/event.rs:97–106  ·  view source on GitHub ↗

Returns true if this Event is an init event, and false otherwise

(&self)

Source from the content-addressed store, hash-verified

95{
96 /// Returns true if this Event is an init event, and false otherwise
97 pub fn is_init(&self) -> bool {
98 match self {
99 Event::Time(_) => false,
100 Event::Signed(event) => match event.payload() {
101 Payload::Data(_) => false,
102 Payload::Init(_) => true,
103 },
104 Event::Unsigned(_) => true,
105 }
106 }
107
108 /// Returns the init payload if the event is an init event, otherwise returns None.
109 pub fn init_payload(&self) -> Option<&init::Payload<D>> {

Calls 1

payloadMethod · 0.45

Tested by

no test coverage detected