pub enum DatabaseUrl {
Url(String),
Credentials {
base_url: String,
username: Option<String>,
password: Option<String>,
},
}Expand description
Database connection URL input.
Variants§
Url(String)
A complete database URL. Existing percent-encoded URLs use this compatibility mode.
Credentials
A base URL without userinfo plus raw credentials that Forge injects safely.
Implementations§
Source§impl DatabaseUrl
impl DatabaseUrl
Sourcepub fn credentials(
base_url: impl Into<String>,
username: Option<String>,
password: Option<String>,
) -> Self
pub fn credentials( base_url: impl Into<String>, username: Option<String>, password: Option<String>, ) -> Self
Creates a separated-credentials database URL input.
Sourcepub fn as_url(&self) -> Option<&str>
pub fn as_url(&self) -> Option<&str>
Returns the complete URL when this input uses compatibility mode.
Sourcepub fn as_url_mut(&mut self) -> Option<&mut String>
pub fn as_url_mut(&mut self) -> Option<&mut String>
Returns the complete URL mutably when this input uses compatibility mode.
Trait Implementations§
Source§impl Clone for DatabaseUrl
impl Clone for DatabaseUrl
Source§fn clone(&self) -> DatabaseUrl
fn clone(&self) -> DatabaseUrl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseUrl
impl Debug for DatabaseUrl
Source§impl<'de> Deserialize<'de> for DatabaseUrl
impl<'de> Deserialize<'de> for DatabaseUrl
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 From<&str> for DatabaseUrl
impl From<&str> for DatabaseUrl
Source§impl From<String> for DatabaseUrl
impl From<String> for DatabaseUrl
Source§impl PartialEq for DatabaseUrl
impl PartialEq for DatabaseUrl
Source§impl Serialize for DatabaseUrl
impl Serialize for DatabaseUrl
impl Eq for DatabaseUrl
impl StructuralPartialEq for DatabaseUrl
Auto Trait Implementations§
impl Freeze for DatabaseUrl
impl RefUnwindSafe for DatabaseUrl
impl Send for DatabaseUrl
impl Sync for DatabaseUrl
impl Unpin for DatabaseUrl
impl UnwindSafe for DatabaseUrl
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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