pub struct ExternalBindings(pub HashMap<String, ExternalBinding>);Expand description
Map from resource ID to external binding.
Validated at runtime: binding type must match resource type.
Tuple Fields§
§0: HashMap<String, ExternalBinding>Implementations§
Source§impl ExternalBindings
impl ExternalBindings
Sourcepub fn has(&self, resource_id: &str) -> bool
pub fn has(&self, resource_id: &str) -> bool
Checks if a binding exists for the given resource ID.
Sourcepub fn get(&self, resource_id: &str) -> Option<&ExternalBinding>
pub fn get(&self, resource_id: &str) -> Option<&ExternalBinding>
Gets an external binding by resource ID.
Sourcepub fn get_storage(&self, id: &str) -> Result<Option<&StorageBinding>>
pub fn get_storage(&self, id: &str) -> Result<Option<&StorageBinding>>
Gets a storage binding for the given resource ID. Returns an error if the binding exists but is not a Storage type.
Sourcepub fn get_queue(&self, id: &str) -> Result<Option<&QueueBinding>>
pub fn get_queue(&self, id: &str) -> Result<Option<&QueueBinding>>
Gets a queue binding for the given resource ID. Returns an error if the binding exists but is not a Queue type.
Sourcepub fn get_kv(&self, id: &str) -> Result<Option<&KvBinding>>
pub fn get_kv(&self, id: &str) -> Result<Option<&KvBinding>>
Gets a KV binding for the given resource ID. Returns an error if the binding exists but is not a Kv type.
Sourcepub fn get_artifact_registry(
&self,
id: &str,
) -> Result<Option<&ArtifactRegistryBinding>>
pub fn get_artifact_registry( &self, id: &str, ) -> Result<Option<&ArtifactRegistryBinding>>
Gets an artifact registry binding for the given resource ID. Returns an error if the binding exists but is not an ArtifactRegistry type.
Sourcepub fn get_vault(&self, id: &str) -> Result<Option<&VaultBinding>>
pub fn get_vault(&self, id: &str) -> Result<Option<&VaultBinding>>
Gets a vault binding for the given resource ID. Returns an error if the binding exists but is not a Vault type.
Sourcepub fn insert(
&mut self,
resource_id: impl Into<String>,
binding: ExternalBinding,
)
pub fn insert( &mut self, resource_id: impl Into<String>, binding: ExternalBinding, )
Inserts an external binding for a resource.
Trait Implementations§
Source§impl Clone for ExternalBindings
impl Clone for ExternalBindings
Source§fn clone(&self) -> ExternalBindings
fn clone(&self) -> ExternalBindings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExternalBindings
impl Debug for ExternalBindings
Source§impl Default for ExternalBindings
impl Default for ExternalBindings
Source§fn default() -> ExternalBindings
fn default() -> ExternalBindings
Source§impl<'de> Deserialize<'de> for ExternalBindings
impl<'de> Deserialize<'de> for ExternalBindings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ExternalBindings
impl PartialEq for ExternalBindings
Source§impl Serialize for ExternalBindings
impl Serialize for ExternalBindings
impl Eq for ExternalBindings
impl StructuralPartialEq for ExternalBindings
Auto Trait Implementations§
impl Freeze for ExternalBindings
impl RefUnwindSafe for ExternalBindings
impl Send for ExternalBindings
impl Sync for ExternalBindings
impl Unpin for ExternalBindings
impl UnsafeUnpin for ExternalBindings
impl UnwindSafe for ExternalBindings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.