pub struct ModelMerger;Expand description
Merges a base SyntheticModel with a typed SyntheticOverrides
patch, producing a complete candidate model or the diagnostics that
block it.
Implementations§
Source§impl ModelMerger
impl ModelMerger
Sourcepub fn merge(
base: SyntheticModel,
patch: SyntheticOverrides,
) -> Result<(SyntheticModel, DiagnosticBag), DiagnosticBag>
pub fn merge( base: SyntheticModel, patch: SyntheticOverrides, ) -> Result<(SyntheticModel, DiagnosticBag), DiagnosticBag>
Applies patch on top of base, field by field.
Diagnostics are gathered rather than short-circuited: a missing table, a missing column, and a structural schema mismatch on three unrelated tables all get reported together.
On success, the returned DiagnosticBag carries any warnings
produced along the way (e.g. a GEN-SOURCE-FINGERPRINT warning
under warn policy) — it may be empty, but it is never discarded.
This is why the success type is (SyntheticModel, DiagnosticBag)
rather than plain SyntheticModel: a bag with no error-severity
diagnostic still deserves to be seen by the caller. On failure (any
error-severity diagnostic), Err(bag) carries every diagnostic,
warnings included, same as before.
Auto Trait Implementations§
impl Freeze for ModelMerger
impl RefUnwindSafe for ModelMerger
impl Send for ModelMerger
impl Sync for ModelMerger
impl Unpin for ModelMerger
impl UnsafeUnpin for ModelMerger
impl UnwindSafe for ModelMerger
Blanket Implementations§
impl<T> Allocation for T
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
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