pub struct VenClient<K> { /* private fields */ }Expand description
A client for interacting with the data in a specific VEN and the resources contained in the VEN.
Implementations§
Source§impl VenClient<BusinessLogic>
impl VenClient<BusinessLogic>
Sourcepub async fn create_resource<S: Display>(
&self,
name: S,
attributes: Option<Vec<ValuesMap>>,
targets: Vec<Target>,
) -> Result<ResourceClient<BusinessLogic>, Error>
pub async fn create_resource<S: Display>( &self, name: S, attributes: Option<Vec<ValuesMap>>, targets: Vec<Target>, ) -> Result<ResourceClient<BusinessLogic>, Error>
Create a resource as a child of this VEN
Source§impl VenClient<VirtualEndNode>
impl VenClient<VirtualEndNode>
Sourcepub async fn create_resource<S: Display>(
&self,
name: S,
attributes: Option<Vec<ValuesMap>>,
) -> Result<ResourceClient<VirtualEndNode>, Error>
pub async fn create_resource<S: Display>( &self, name: S, attributes: Option<Vec<ValuesMap>>, ) -> Result<ResourceClient<VirtualEndNode>, Error>
Create a resource as a child of this VEN
Source§impl<K: ClientKind> VenClient<K>
impl<K: ClientKind> VenClient<K>
Sourcepub fn created_date_time(&self) -> DateTime<Utc>
pub fn created_date_time(&self) -> DateTime<Utc>
Get the time the VEN 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 VEN was last modified on the VTN
Sourcepub fn content(&self) -> &BlVenRequest
pub fn content(&self) -> &BlVenRequest
Read the content of the VEN
Sourcepub fn content_mut(&mut self) -> &mut BlVenRequest
pub fn content_mut(&mut self) -> &mut BlVenRequest
Modify the content of the VEN.
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 VEN content at the VTN and refreshes the data stored locally with the returned VTN data
Sourcepub async fn delete(self) -> Result<Ven, Error>
pub async fn delete(self) -> Result<Ven, Error>
Delete the VEN from the VTN.
Depending on the VTN implementation, you may need to delete all associated resources before you can delete the VEN
Sourcepub async fn get_all_resources(
&self,
resource_name: Option<&str>,
) -> Result<Vec<ResourceClient<K>>, Error>
pub async fn get_all_resources( &self, resource_name: Option<&str>, ) -> Result<Vec<ResourceClient<K>>, Error>
Get all resources stored as children of this VEN.
The client automatically tries to iterate pages where necessary.
Sourcepub async fn get_resource_by_id(
&self,
id: &ResourceId,
) -> Result<ResourceClient<K>, Error>
pub async fn get_resource_by_id( &self, id: &ResourceId, ) -> Result<ResourceClient<K>, Error>
Get a resource by its ID
Sourcepub async fn get_resource_by_name(
&self,
name: &str,
) -> Result<ResourceClient<K>, Error>
pub async fn get_resource_by_name( &self, name: &str, ) -> Result<ResourceClient<K>, Error>
Get VEN by name from VTN.
According to the spec, a resource_name must be unique per VEN.
Trait Implementations§
Auto Trait Implementations§
impl<K> !RefUnwindSafe for VenClient<K>
impl<K> !UnwindSafe for VenClient<K>
impl<K> Freeze for VenClient<K>
impl<K> Send for VenClient<K>
impl<K> Sync for VenClient<K>
impl<K> Unpin for VenClient<K>
impl<K> UnsafeUnpin for VenClient<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