pub struct ResourceReference {
pub provider: String,
pub team: Option<String>,
pub resource_type: Option<ResourceType>,
pub lookup: LookupBy,
}Expand description
Parsed resource reference
Supports multiple formats:
name-> local.name.{name}local.name.{name}-> explicit local lookup{provider}.id.{id}-> provider-wide ID lookup{provider}.{team}.id.{id}-> team-scoped ID lookup{provider}.{team}.{type}.name.{name}-> full path lookup{provider}.{team}.{type}.id.{id}-> full path lookup by ID
Fields§
§provider: StringProvider name (e.g., “local”, “runbeam”)
team: Option<String>Optional team identifier
resource_type: Option<ResourceType>Optional resource type
lookup: LookupByHow to look up the resource
Implementations§
Source§impl ResourceReference
impl ResourceReference
Sourcepub fn parse(input: &str) -> Result<Self, String>
pub fn parse(input: &str) -> Result<Self, String>
Parse a resource reference string
§Examples
use runbeam_sdk::runbeam_api::types::ResourceReference;
// Bare name -> local.name.{name}
let r = ResourceReference::parse("my_ingress").unwrap();
assert_eq!(r.provider, "local");
// Full path
let r = ResourceReference::parse("runbeam.acme.ingress.name.patient_api").unwrap();
assert_eq!(r.provider, "runbeam");Sourcepub fn to_reference_string(&self) -> String
pub fn to_reference_string(&self) -> String
Convert back to string representation
Trait Implementations§
Source§impl Clone for ResourceReference
impl Clone for ResourceReference
Source§fn clone(&self) -> ResourceReference
fn clone(&self) -> ResourceReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceReference
impl Debug for ResourceReference
Source§impl PartialEq for ResourceReference
impl PartialEq for ResourceReference
impl Eq for ResourceReference
impl StructuralPartialEq for ResourceReference
Auto Trait Implementations§
impl Freeze for ResourceReference
impl RefUnwindSafe for ResourceReference
impl Send for ResourceReference
impl Sync for ResourceReference
impl Unpin for ResourceReference
impl UnwindSafe for ResourceReference
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.