pub struct ViewMetadataBuilder { /* private fields */ }Expand description
Manipulating view metadata.
For this builder the order of called functions matters.
All operations applied to the ViewMetadata are tracked in changes as a chronologically
ordered vec of ViewUpdate.
If an operation does not lead to a change of the ViewMetadata, the corresponding update
is omitted from changes.
Implementations§
Source§impl ViewMetadataBuilder
impl ViewMetadataBuilder
Sourcepub fn new(
location: String,
schema: Schema,
view_version: ViewVersion,
format_version: ViewFormatVersion,
properties: HashMap<String, String>,
) -> Result<Self>
pub fn new( location: String, schema: Schema, view_version: ViewVersion, format_version: ViewFormatVersion, properties: HashMap<String, String>, ) -> Result<Self>
Creates a new view metadata builder.
Sourcepub fn new_from_metadata(previous: ViewMetadata) -> Self
pub fn new_from_metadata(previous: ViewMetadata) -> Self
Creates a new view metadata builder from the given metadata to modify it.
Sourcepub fn from_view_creation(view_creation: ViewCreation) -> Result<Self>
pub fn from_view_creation(view_creation: ViewCreation) -> Result<Self>
Creates a new view metadata builder from the given view creation.
Sourcepub fn upgrade_format_version(
self,
format_version: ViewFormatVersion,
) -> Result<Self>
pub fn upgrade_format_version( self, format_version: ViewFormatVersion, ) -> Result<Self>
Upgrade FormatVersion. Downgrades are not allowed.
§Errors
- Cannot downgrade to older format versions.
Sourcepub fn set_location(self, location: String) -> Self
pub fn set_location(self, location: String) -> Self
Set the location of the view, stripping any trailing slashes.
Sourcepub fn set_current_version_id(self, version_id: i32) -> Result<Self>
pub fn set_current_version_id(self, version_id: i32) -> Result<Self>
Set an existing view version as the current version.
§Errors
- The specified
version_iddoes not exist. - The specified
version_idis-1but no version has been added.
Sourcepub fn set_current_version(
self,
view_version: ViewVersion,
schema: Schema,
) -> Result<Self>
pub fn set_current_version( self, view_version: ViewVersion, schema: Schema, ) -> Result<Self>
Add a new view version and set it as current.
Sourcepub fn add_version(self, view_version: ViewVersion) -> Result<Self>
pub fn add_version(self, view_version: ViewVersion) -> Result<Self>
Add a new version to the view.
§Errors
- The schema ID of the version is set to
-1, but no schema has been added. - The schema ID of the specified version is unknown.
- Multiple queries for the same dialect are added.
Sourcepub fn add_schema(self, schema: Schema) -> Self
pub fn add_schema(self, schema: Schema) -> Self
Add a new schema to the view.
Sourcepub fn set_properties(self, updates: HashMap<String, String>) -> Result<Self>
pub fn set_properties(self, updates: HashMap<String, String>) -> Result<Self>
Update properties of the view.
Sourcepub fn remove_properties(self, removals: &[String]) -> Self
pub fn remove_properties(self, removals: &[String]) -> Self
Remove properties from the view
Sourcepub fn assign_uuid(self, uuid: Uuid) -> Self
pub fn assign_uuid(self, uuid: Uuid) -> Self
Assign a new UUID to the view.
Trait Implementations§
Source§impl Clone for ViewMetadataBuilder
impl Clone for ViewMetadataBuilder
Source§fn clone(&self) -> ViewMetadataBuilder
fn clone(&self) -> ViewMetadataBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ViewMetadataBuilder
impl RefUnwindSafe for ViewMetadataBuilder
impl Send for ViewMetadataBuilder
impl Sync for ViewMetadataBuilder
impl Unpin for ViewMetadataBuilder
impl UnwindSafe for ViewMetadataBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§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> ⓘ
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