pub struct SchemaEvolutionFrame {
pub session_id: String,
pub old_version: SchemaVersion,
pub new_version: SchemaVersion,
pub schema_ipc: Vec<u8>,
}Expand description
Wire frame that signals a schema change mid-stream in a TensorSwap session.
When a sender wants to start emitting data using a different Arrow schema it
first serialises a SchemaEvolutionFrame and transmits it to the receiver.
The receiver must acknowledge the new schema before the sender continues
with Arrow IPC batches encoded against new_version.
Fields§
§session_id: StringIdentifier of the TensorSwap session this evolution applies to.
old_version: SchemaVersionThe schema version that was active before the change.
new_version: SchemaVersionThe schema version that will be used after the change.
schema_ipc: Vec<u8>Serialised Arrow IPC Schema message bytes for new_version.
Encoded using arrow::ipc::writer::schema_to_bytes so that the
receiver can reconstruct the full Schema without registry access.
Implementations§
Source§impl SchemaEvolutionFrame
impl SchemaEvolutionFrame
Sourcepub fn new(
session_id: impl Into<String>,
old_version: SchemaVersion,
new_version: SchemaVersion,
new_schema: &Schema,
) -> Self
pub fn new( session_id: impl Into<String>, old_version: SchemaVersion, new_version: SchemaVersion, new_schema: &Schema, ) -> Self
Construct a SchemaEvolutionFrame, serialising new_schema into Arrow
IPC format automatically.
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, SchemaError>
pub fn to_bytes(&self) -> Result<Vec<u8>, SchemaError>
Serialise this frame to JSON bytes suitable for transmission.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SchemaError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SchemaError>
Deserialise a SchemaEvolutionFrame from JSON bytes.
Sourcepub fn decode_schema(&self) -> Result<Arc<Schema>, SchemaError>
pub fn decode_schema(&self) -> Result<Arc<Schema>, SchemaError>
Recover the Arrow Schema embedded in schema_ipc.
Trait Implementations§
Source§impl Clone for SchemaEvolutionFrame
impl Clone for SchemaEvolutionFrame
Source§fn clone(&self) -> SchemaEvolutionFrame
fn clone(&self) -> SchemaEvolutionFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaEvolutionFrame
impl Debug for SchemaEvolutionFrame
Source§impl<'de> Deserialize<'de> for SchemaEvolutionFrame
impl<'de> Deserialize<'de> for SchemaEvolutionFrame
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>,
Auto Trait Implementations§
impl Freeze for SchemaEvolutionFrame
impl RefUnwindSafe for SchemaEvolutionFrame
impl Send for SchemaEvolutionFrame
impl Sync for SchemaEvolutionFrame
impl Unpin for SchemaEvolutionFrame
impl UnsafeUnpin for SchemaEvolutionFrame
impl UnwindSafe for SchemaEvolutionFrame
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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