fvm_sdk/sys/
event.rs

1// Copyright 2021-2023 Protocol Labs
2// SPDX-License-Identifier: Apache-2.0, MIT
3//! Syscalls related to eventing.
4
5// for documentation links
6#[cfg(doc)]
7use crate::sys::ErrorNumber::*;
8
9// For documentation
10#[doc(inline)]
11pub use fvm_shared::sys::EventEntry;
12
13super::fvm_syscalls! {
14    module = "event";
15
16    /// Emits an actor event to be recorded in the receipt.
17    ///
18    /// # Errors
19    ///
20    /// | Error               | Reason                                                              |
21    /// |---------------------|---------------------------------------------------------------------|
22    /// | [`IllegalArgument`] | entries failed to validate due to improper encoding or invalid data |
23    /// | [`ReadOnly`]        | cannot send events while read-only                                  |
24    pub fn emit_event(
25        evt_off: *const EventEntry,
26        evt_len: u32,
27        key_off: *const u8,
28        key_len: u32,
29        value_off: *const u8,
30        value_len: u32,
31    ) -> Result<()>;
32}