EventsResource

Type Alias EventsResource 

Source
pub type EventsResource = Resource<Event>;
Expand description

Event objects store complex information about multiple assets over a time period. Typical types of events might include Alarms, Process Data, and Logs.

For storage of low volume, manually generated, schedulable activities such as maintenance schedules, work orders, or other “appointment” type activities. The Data Modelling service is now recommended.

For storage of very high volume discrete events, consider using time series.

Aliased Type§

pub struct EventsResource {
    pub api_client: Arc<ApiClient>,
    /* private fields */
}

Fields§

§api_client: Arc<ApiClient>

A reference to the shared API Client.

Implementations§

Source§

impl EventsResource

Source

pub async fn aggregate( &self, aggregate: EventAggregateRequest, ) -> Result<Vec<EventAggregateResponse>>

Compute aggregates over events, such as getting the count of all events in a project, checking different names and descriptions of events in your project, etc.

§Arguments
  • aggregate - Aggregate to compute

The returned aggregates depend on which aggregates were requested.

Trait Implementations§

Source§

impl CleanResource<Event> for EventsResource

Source§

async fn clean_resource(&self, resources: Vec<Event>) -> Result<(), Error>

Delete the provided resources.
Source§

impl Create<AddEvent, Event> for EventsResource

Source§

fn create( &self, creates: &[TCreate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Create a list of resources. Read more
Source§

fn create_from( &self, creates: &[impl Into<TCreate> + Sync + Clone], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Create a list of resources, converting from a different type. Read more
Source§

fn create_ignore_duplicates( &self, creates: &[TCreate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TCreate: EqIdentity,

Create a list of resources, ignoring any that fail with general “conflict” errors. Read more
Source§

fn create_from_ignore_duplicates<'a, T: 'a>( &self, creates: &'a [impl Into<TCreate> + Sync + Clone], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TCreate: EqIdentity,

Create a list of resources, converting from a different type, and ignoring any that fail with general “conflict” errors. Read more
Source§

impl<R> DeleteWithIgnoreUnknownIds<IdentityList<R>> for EventsResource
where IdentityList<R>: Serialize, R: Send + Sync,

Source§

fn delete( &self, deletes: impl Into<TIdt> + Send, ignore_unknown_ids: bool, ) -> impl Future<Output = Result<()>> + Send
where Self: Sync,

Delete a list of resources, optionally ignore unknown ids. Read more
Source§

impl FilterWithRequest<EventFilterQuery, Event> for EventsResource

Source§

fn filter( &self, filter: TFilter, ) -> impl Future<Output = Result<ItemsVec<TResponse, Cursor>>> + Send

Filter resources. Read more
Source§

fn filter_all( &self, filter: TFilter, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TFilter: SetCursor, TResponse: Send,

Filter resources, following cursors until they are exhausted. Read more
Source§

fn filter_all_stream( &self, filter: TFilter, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TFilter: SetCursor, TResponse: Send + 'static,

Filter resources, following cursors. This returns a stream, you can abort the stream whenever you want and only resources retrieved up to that point will be returned. Read more
Source§

fn filter_all_partitioned( &self, filter: TFilter, num_partitions: u32, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TFilter: SetCursor + WithPartition, TResponse: Send,

Filter resources using partitioned reads, following cursors until all partitions are exhausted. Read more
Source§

fn filter_all_partitioned_stream( &self, filter: TFilter, num_partitions: u32, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TFilter: SetCursor + WithPartition, TResponse: Send + 'static,

Filter resources using partitioned reads, following cursors until all partitions are exhausted. This returns a stream. Read more
Source§

impl<R> RetrieveWithIgnoreUnknownIds<IdentityList<R>, Event> for EventsResource
where IdentityList<R>: Serialize, R: Send + Sync,

Source§

fn retrieve( &self, ids: impl Into<TIdt> + Send, ignore_unknown_ids: bool, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Retrieve a list of items from CDF. If ignore_unknown_ids is false, this will fail if any items are missing from CDF. Read more
Source§

impl SearchItems<'_, EventFilter, EventSearch, Event> for EventsResource

Source§

fn search( &'a self, filter: TFilter, search: TSearch, limit: Option<u32>, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Fuzzy search resources. Read more
Source§

impl Update<Patch<PatchEvent>, Event> for EventsResource

Source§

fn update( &self, updates: &[TUpdate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send

Update a list of resources. Read more
Source§

fn update_from<'a, T>( &self, updates: &'a [T], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where T: Sync + Clone + 'a, TUpdate: From<T>,

Update a list of resources by converting to the update from a different type. Read more
Source§

fn update_ignore_unknown_ids( &self, updates: &[TUpdate], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TUpdate: EqIdentity, TResponse: Send,

Update a list of resources, ignoring any that fail due to items missing in CDF. Read more
Source§

fn update_from_ignore_unknown_ids<'a, T>( &self, updates: &'a [T], ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where T: Sync + Clone + 'a, TUpdate: From<T> + EqIdentity, TResponse: Send,

Update a list of resources by converting from a different type, ignoring any that fail due items missing in CDF. Read more
Source§

impl WithBasePath for EventsResource

Source§

const BASE_PATH: &'static str = "events"

Base path for this resource type.