pub struct Metadata {
pub version: Version,
pub instance: InstanceName,
pub image: Reference,
pub superuser: SuperuserMetadata,
pub seeds: Vec<SeedEntry>,
pub ssl: Option<SslMetadata>,
}Expand description
Decoded pg-ephemeral metadata read back from an image or container’s labels. Container labels propagate verbatim from the image they were launched from, so the same shape covers both scopes.
Fields§
§version: Version§instance: InstanceName§image: Reference§superuser: SuperuserMetadata§seeds: Vec<SeedEntry>§ssl: Option<SslMetadata>Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn prepare_config(
self,
host: Host,
host_addr: Option<HostAddr>,
port: Port,
) -> Result<Config, PrepareConfigError>
pub fn prepare_config( self, host: Host, host_addr: Option<HostAddr>, port: Port, ) -> Result<Config, PrepareConfigError>
Materialize a pg_client::Config for the given runtime endpoint.
If Metadata::ssl is set, the CA certificate PEM is written to a
uniquely-named file in std::env::temp_dir() via
[crate::certificate::write_ca_pem_to_temp]. The file is not
removed automatically.
Trait Implementations§
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnsafeUnpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more