Skip to main content

NeonBranchSource

Struct NeonBranchSource 

Source
pub struct NeonBranchSource { /* private fields */ }
Available on crate feature neon only.
Expand description

The overlay of the Neon branch an instance is bound to (its source config is a NeonBinding):

  • Postgres: PGHOST (the direct host), PGUSER, PGDATABASE and PGPASSWORD, which the plan’s hosted-postgres reads, and DATABASE_URL (through the pooler) and DATABASE_URL_UNPOOLED for whatever reads those;
  • object storage, when the binding has a credential: NEON_S3_ENDPOINT, NEON_S3_REGION, NEON_S3_ACCESS_KEY_ID and NEON_S3_SECRET_ACCESS_KEY;
  • every bound function’s URL, in its variable (UNITYCATALOG_FUNCTION_URL). A function gone from the branch since binding is an error.

Neon’s credentials don’t expire, so the overlay never needs a refresh.

Implementations§

Source§

impl NeonBranchSource

Source

pub fn new(neon: Arc<dyn NeonControl>, secrets: SecretProviders) -> Self

The source, asking neon, with the storage credential’s secret resolved by secrets.

Trait Implementations§

Source§

impl Source for NeonBranchSource

Source§

fn name(&self) -> &str

The name instances refer to it by.
Source§

fn overlay<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 SourceCtx, ) -> Pin<Box<dyn Future<Output = Result<Overlay, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The overlay for the instance ctx describes.
Source§

fn refresh<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 SourceCtx, current: &'life2 Overlay, ) -> Pin<Box<dyn Future<Output = Result<Overlay, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

A fresh overlay once current has expired. The default asks again.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.