Skip to main content

EventSystem

Struct EventSystem 

Source
pub struct EventSystem { /* private fields */ }
Expand description

Owns an event-system directory and creates typed event streams within it.

Implementations§

Source§

impl EventSystem

Source

pub fn new( event_system_directory: impl AsRef<Path>, ) -> Result<Self, CreateEventSystemError>

Creates an event system directory in the given path, event_system_directory.

§Note:
  • If the directory path already exists, it must be empty.
  • This functions creates the given directory and any missing parents.
  • The given path is canonicalized.
  • The directory is emptied once this EventSystem, its clones, and all of its streams (including their PublisherFactorys and publishers) are dropped. The directory itself is left in place, and can be reused by a later call to EventSystem::new.
Source

pub fn stub() -> Self

Creates a no-op event system on any platform, including Linux.

No filesystem access is performed. Streams ignore their configuration and policy, and their factories always return publishers that discard events without serializing them.

Source

pub fn create_stream<E: Event>( &self, stream_name: StreamName, stream_config: StreamConfig, ) -> Result<PublisherFactory<E>, CreateStreamError>

Creates a stream named stream_name for event type E and returns its PublisherFactory.

Source

pub fn set_stream_policy(&self, stream_policy: StreamPolicy)

Applies the given StreamPolicy on the streams created by this EventSystem.

The applied stream policy will also be applied to future stream creations of this event system.

Trait Implementations§

Source§

impl Clone for EventSystem

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventSystem

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.