pub struct OciConfigBuilder { /* private fields */ }Expand description
OCI configuration builder
Implementations§
Source§impl OciConfigBuilder
impl OciConfigBuilder
Sourcepub fn config(self, path: impl AsRef<Path>) -> Result<Self>
pub fn config(self, path: impl AsRef<Path>) -> Result<Self>
Load configuration from OCI config file
Always uses the “DEFAULT” profile.
§Arguments
path: File path to OCI config file (e.g.,~/.oci/config)
§Example
// Load from file
let config = OciConfig::builder()
.config("/path/to/.oci/config")?
.private_key("/path/to/key.pem")? // Optional override
.build()?;pub fn user_id(self, user_id: impl Into<String>) -> Self
pub fn tenancy_id(self, tenancy_id: impl Into<String>) -> Self
pub fn region(self, region: impl Into<String>) -> Self
pub fn fingerprint(self, fingerprint: impl Into<String>) -> Self
Sourcepub fn private_key(self, private_key: impl Into<String>) -> Result<Self>
pub fn private_key(self, private_key: impl Into<String>) -> Result<Self>
Set private key (file path or PEM content)
Automatically detects whether the input is a file path or PEM content.
§Example
// From file path
let config = OciConfig::builder()
.config("/path/to/.oci/config")?
.private_key("/path/to/key.pem")?
.build()?;
// From PEM content
let config = OciConfig::builder()
.config("/path/to/.oci/config")?
.private_key("-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----")?
.build()?;pub fn compartment_id(self, compartment_id: impl Into<String>) -> Self
pub fn build(self) -> Result<OciConfig>
Trait Implementations§
Source§impl Default for OciConfigBuilder
impl Default for OciConfigBuilder
Source§fn default() -> OciConfigBuilder
fn default() -> OciConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OciConfigBuilder
impl RefUnwindSafe for OciConfigBuilder
impl Send for OciConfigBuilder
impl Sync for OciConfigBuilder
impl Unpin for OciConfigBuilder
impl UnwindSafe for OciConfigBuilder
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