pub struct Protocol {
pub min_reader_version: i32,
pub min_writer_version: i32,
pub reader_features: Option<HashSet<ReaderFeatures>>,
pub writer_features: Option<HashSet<WriterFeatures>>,
}
Expand description
Defines a protocol action
Fields§
§min_reader_version: i32
The minimum version of the Delta read protocol that a client must implement in order to correctly read this table
min_writer_version: i32
The minimum version of the Delta write protocol that a client must implement in order to correctly write this table
reader_features: Option<HashSet<ReaderFeatures>>
A collection of features that a client must implement in order to correctly read this table (exist only when minReaderVersion is set to 3)
writer_features: Option<HashSet<WriterFeatures>>
A collection of features that a client must implement in order to correctly write this table (exist only when minWriterVersion is set to 7)
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn new(min_reader_version: i32, min_writer_version: i32) -> Self
pub fn new(min_reader_version: i32, min_writer_version: i32) -> Self
Create a new protocol action
Sourcepub fn with_reader_features(
self,
reader_features: impl IntoIterator<Item = impl Into<ReaderFeatures>>,
) -> Self
pub fn with_reader_features( self, reader_features: impl IntoIterator<Item = impl Into<ReaderFeatures>>, ) -> Self
set the reader features in the protocol action, automatically bumps min_reader_version
Sourcepub fn with_writer_features(
self,
writer_features: impl IntoIterator<Item = impl Into<WriterFeatures>>,
) -> Self
pub fn with_writer_features( self, writer_features: impl IntoIterator<Item = impl Into<WriterFeatures>>, ) -> Self
set the writer features in the protocol action, automatically bumps min_writer_version
Sourcepub fn move_table_properties_into_features(
self,
configuration: &HashMap<String, Option<String>>,
) -> Protocol
pub fn move_table_properties_into_features( self, configuration: &HashMap<String, Option<String>>, ) -> Protocol
Converts existing properties into features if the reader_version is >=3 or writer_version >=7 only converts features that are “true”
Sourcepub fn apply_properties_to_protocol(
self,
new_properties: &HashMap<String, String>,
raise_if_not_exists: bool,
) -> DeltaResult<Protocol>
pub fn apply_properties_to_protocol( self, new_properties: &HashMap<String, String>, raise_if_not_exists: bool, ) -> DeltaResult<Protocol>
Will apply the properties to the protocol by either bumping the version or setting features
Sourcepub fn enable_timestamp_ntz(self) -> Protocol
pub fn enable_timestamp_ntz(self) -> Protocol
Enable timestamp_ntz in the protocol
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Protocol
impl<'de> Deserialize<'de> for Protocol
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>,
impl Eq for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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