pub enum Reference {
Resource(ResourceReference),
Prompt(PromptReference),
}Variants§
Resource(ResourceReference)
Prompt(PromptReference)
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn for_prompt(name: impl Into<String>) -> Self
pub fn for_prompt(name: impl Into<String>) -> Self
Create a prompt reference
Sourcepub fn for_resource(uri: impl Into<String>) -> Self
pub fn for_resource(uri: impl Into<String>) -> Self
Create a resource reference
Sourcepub fn reference_type(&self) -> &'static str
pub fn reference_type(&self) -> &'static str
Get the reference type as a string
Sourcepub fn as_prompt_name(&self) -> Option<&str>
pub fn as_prompt_name(&self) -> Option<&str>
Extract prompt name if this is a prompt reference
Sourcepub fn as_resource_uri(&self) -> Option<&str>
pub fn as_resource_uri(&self) -> Option<&str>
Extract resource URI if this is a resource reference
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Reference
impl JsonSchema for Reference
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnsafeUnpin for Reference
impl UnwindSafe for Reference
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