pub struct EnvironmentSource {
pub source_type: Option<SourceType>,
pub source: Option<String>,
pub target: Option<String>,
pub content: Option<String>,
pub encoding: Option<String>,
pub extra: Map<String, Value>,
}Expand description
A source to be mounted into an environment.
§Example
use genai_rs::EnvironmentSource;
// Mount a GCS bucket at /data
let gcs = EnvironmentSource::gcs("gs://my-bucket/data", "/data");
// Provide an inline file
let inline = EnvironmentSource::inline("/etc/config.toml", "verbose = true");Fields§
§source_type: Option<SourceType>The kind of source (wire: type).
source: Option<String>The source location. For GCS this is the GCS path; for repositories this is the repository path.
target: Option<String>Where the source should appear in the environment.
content: Option<String>The inline content when source_type is SourceType::Inline.
encoding: Option<String>Optional encoding for inline content (e.g., base64).
extra: Map<String, Value>Additional fields not yet modeled (Evergreen forward compatibility)
Implementations§
Source§impl EnvironmentSource
impl EnvironmentSource
Sourcepub fn gcs(source: impl Into<String>, target: impl Into<String>) -> Self
pub fn gcs(source: impl Into<String>, target: impl Into<String>) -> Self
Creates a GCS source mounted at target.
Sourcepub fn inline(target: impl Into<String>, content: impl Into<String>) -> Self
pub fn inline(target: impl Into<String>, content: impl Into<String>) -> Self
Creates an inline source placed at target with the given content.
Sourcepub fn repository(source: impl Into<String>, target: impl Into<String>) -> Self
pub fn repository(source: impl Into<String>, target: impl Into<String>) -> Self
Creates a repository source mounted at target.
Sourcepub fn skill_registry(source: impl Into<String>) -> Self
pub fn skill_registry(source: impl Into<String>) -> Self
Creates a skill-registry source.
Sourcepub fn with_encoding(self, encoding: impl Into<String>) -> Self
pub fn with_encoding(self, encoding: impl Into<String>) -> Self
Sets the encoding for inline content (e.g., base64).
Trait Implementations§
Source§impl Clone for EnvironmentSource
impl Clone for EnvironmentSource
Source§impl Debug for EnvironmentSource
impl Debug for EnvironmentSource
Source§impl Default for EnvironmentSource
impl Default for EnvironmentSource
Source§impl<'de> Deserialize<'de> for EnvironmentSourcewhere
EnvironmentSource: Default,
impl<'de> Deserialize<'de> for EnvironmentSourcewhere
EnvironmentSource: Default,
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 EnvironmentSource
impl PartialEq for EnvironmentSource
Source§impl Serialize for EnvironmentSource
impl Serialize for EnvironmentSource
impl StructuralPartialEq for EnvironmentSource
Auto Trait Implementations§
impl Freeze for EnvironmentSource
impl RefUnwindSafe for EnvironmentSource
impl Send for EnvironmentSource
impl Sync for EnvironmentSource
impl Unpin for EnvironmentSource
impl UnsafeUnpin for EnvironmentSource
impl UnwindSafe for EnvironmentSource
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);