pub struct ProgramClient<K> { /* private fields */ }Expand description
A client for interacting with the data in a specific program and the events contained in the program.
Implementations§
Source§impl<K: ClientKind> ProgramClient<K>
impl<K: ClientKind> ProgramClient<K>
Sourcepub fn created_date_time(&self) -> DateTime<Utc>
pub fn created_date_time(&self) -> DateTime<Utc>
Get the time the program was created on the VTN
Sourcepub fn modification_date_time(&self) -> DateTime<Utc>
pub fn modification_date_time(&self) -> DateTime<Utc>
Get the time the program was last modified on the VTN
Sourcepub fn content(&self) -> &ProgramRequest
pub fn content(&self) -> &ProgramRequest
Read the data of the program
Sourcepub fn content_mut(&mut self) -> &mut ProgramRequest
pub fn content_mut(&mut self) -> &mut ProgramRequest
Modify the data of the program.
Make sure to call update
after your modifications to store them on the VTN
Sourcepub async fn update(&mut self) -> Result<(), Error>
pub async fn update(&mut self) -> Result<(), Error>
Stores any modifications made to the program content at the server and refreshes the locally stored data with the returned VTN data
Sourcepub async fn create_event(
&self,
event_data: EventRequest,
) -> Result<EventClient<K>, Error>
pub async fn create_event( &self, event_data: EventRequest, ) -> Result<EventClient<K>, Error>
Create a new event on the VTN.
The content should be created with ProgramClient::new_event
to automatically insert the correct program ID
Sourcepub fn new_event(&self, intervals: Vec<EventInterval>) -> EventRequest
pub fn new_event(&self, intervals: Vec<EventInterval>) -> EventRequest
Create a new event object within the program
Sourcepub async fn get_events_request(
&self,
filter: Filter<'_, impl AsRef<str>>,
pagination: PaginationOptions,
) -> Result<Vec<EventClient<K>>, Error>
pub async fn get_events_request( &self, filter: Filter<'_, impl AsRef<str>>, pagination: PaginationOptions, ) -> Result<Vec<EventClient<K>>, Error>
Low-level operation that gets a list of events for this program from the VTN with the given query parameters.
To automatically iterate pages, use self.get_event_list
Sourcepub async fn get_event_list(
&self,
filter: Filter<'_, impl AsRef<str> + Clone>,
) -> Result<Vec<EventClient<K>>, Error>
pub async fn get_event_list( &self, filter: Filter<'_, impl AsRef<str> + Clone>, ) -> Result<Vec<EventClient<K>>, Error>
Get a list of events from the VTN with the given query parameters
Trait Implementations§
Source§impl<K: Clone> Clone for ProgramClient<K>
impl<K: Clone> Clone for ProgramClient<K>
Source§fn clone(&self) -> ProgramClient<K>
fn clone(&self) -> ProgramClient<K>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<K> !RefUnwindSafe for ProgramClient<K>
impl<K> !UnwindSafe for ProgramClient<K>
impl<K> Freeze for ProgramClient<K>
impl<K> Send for ProgramClient<K>
impl<K> Sync for ProgramClient<K>
impl<K> Unpin for ProgramClient<K>
impl<K> UnsafeUnpin for ProgramClient<K>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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