pub struct ResolveConfig { /* private fields */ }Expand description
Configuration for migration resolution using ResolveWith.
Implementations§
Source§impl ResolveConfig
impl ResolveConfig
Sourcepub fn new() -> ResolveConfig
pub fn new() -> ResolveConfig
Return a default, empty configuration.
Sourcepub fn ignore_char(&mut self, c: char) -> &mut ResolveConfig
pub fn ignore_char(&mut self, c: char) -> &mut ResolveConfig
Ignore a character when hashing migrations.
The migration SQL string itself will still contain the character, but it will not be included when calculating the checksum.
This can be used to ignore whitespace characters so changing formatting does not change the checksum.
Adding the same char more than once is a no-op.
§Note: Changes Migration Checksum
This will change the checksum of resolved migrations, which may cause problems with existing deployments.
Use at your own risk.
Sourcepub fn ignore_chars(
&mut self,
chars: impl IntoIterator<Item = char>,
) -> &mut ResolveConfig
pub fn ignore_chars( &mut self, chars: impl IntoIterator<Item = char>, ) -> &mut ResolveConfig
Ignore one or more characters when hashing migrations.
The migration SQL string itself will still contain these characters, but they will not be included when calculating the checksum.
This can be used to ignore whitespace characters so changing formatting does not change the checksum.
Adding the same char more than once is a no-op.
§Note: Changes Migration Checksum
This will change the checksum of resolved migrations, which may cause problems with existing deployments.
Use at your own risk.
Sourcepub fn ignored_chars(&self) -> impl Iterator<Item = char>
pub fn ignored_chars(&self) -> impl Iterator<Item = char>
Iterate over the set of ignored characters.
Duplicate chars are not included.
Trait Implementations§
Source§impl Debug for ResolveConfig
impl Debug for ResolveConfig
Source§impl Default for ResolveConfig
impl Default for ResolveConfig
Source§fn default() -> ResolveConfig
fn default() -> ResolveConfig
Auto Trait Implementations§
impl Freeze for ResolveConfig
impl RefUnwindSafe for ResolveConfig
impl Send for ResolveConfig
impl Sync for ResolveConfig
impl Unpin for ResolveConfig
impl UnwindSafe for ResolveConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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> ⓘ
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> ⓘ
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