pub trait ResourceCollectionContext {
fn add_collection_context(
&self
) -> Result<Option<PythonResourceAddCollectionContext>, ValueError>;
fn replace_add_collection_context(
&mut self,
add_context: PythonResourceAddCollectionContext
) -> Result<Option<PythonResourceAddCollectionContext>, ValueError>;
fn as_python_resource(&self) -> Result<PythonResource<'_>, ValueError>;
fn add_collection_context_attrs(&self) -> Vec<&'static str>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, { ... }
fn get_attr_add_collection_context(&self, attribute: &str) -> ValueResult { ... }
fn set_attr_add_collection_context(
&mut self,
attribute: &str,
value: Value
) -> Result<(), ValueError> { ... }
}Expand description
Defines functionality for exposing PythonResourceAddCollectionContext from a type.
Required methods
fn add_collection_context(
&self
) -> Result<Option<PythonResourceAddCollectionContext>, ValueError>
fn add_collection_context(
&self
) -> Result<Option<PythonResourceAddCollectionContext>, ValueError>
Obtain the PythonResourceAddCollectionContext associated with this instance, if available.
fn replace_add_collection_context(
&mut self,
add_context: PythonResourceAddCollectionContext
) -> Result<Option<PythonResourceAddCollectionContext>, ValueError>
fn replace_add_collection_context(
&mut self,
add_context: PythonResourceAddCollectionContext
) -> Result<Option<PythonResourceAddCollectionContext>, ValueError>
Set the PythonResourceAddCollectionContext value on this instance.
Returns the old value.
fn as_python_resource(&self) -> Result<PythonResource<'_>, ValueError>
fn as_python_resource(&self) -> Result<PythonResource<'_>, ValueError>
Cast this instance to a PythonResource.
Provided methods
Obtains the Starlark object attributes that are defined by the add collection context.
fn get_attr_add_collection_context(&self, attribute: &str) -> ValueResult
fn get_attr_add_collection_context(&self, attribute: &str) -> ValueResult
Obtain the attribute value for an add collection context.
The caller should verify the attribute should be serviced by us before calling.