pub struct PyroSchema<'a> {
pub documentation: Option<Cow<'a, str>>,
pub fields: Cow<'a, [PyroField<'a>]>,
}Expand description
An ordered collection of PyroFields — the Pyro equivalent of arrow::datatypes::Schema.
Fields§
§documentation: Option<Cow<'a, str>>§fields: Cow<'a, [PyroField<'a>]>Implementations§
Source§impl<'a> PyroSchema<'a>
impl<'a> PyroSchema<'a>
pub fn new(fields: Vec<PyroField<'a>>) -> Self
pub fn empty() -> Self
pub fn fields(&self) -> &[PyroField<'a>]
pub fn num_fields(&self) -> usize
Sourcepub fn field_with_name(&self, name: &str) -> Option<&PyroField<'a>>
pub fn field_with_name(&self, name: &str) -> Option<&PyroField<'a>>
Look up a field by name (linear scan).
Sourcepub fn index_of(&self, name: &str) -> Option<usize>
pub fn index_of(&self, name: &str) -> Option<usize>
Returns column index for the given name, if present.
Sourcepub fn into_owned(self) -> PyroSchema<'static>
pub fn into_owned(self) -> PyroSchema<'static>
Convert to an fully owned schema (useful for inference results).
pub fn add_docstring(self, doc: impl Into<Cow<'a, str>>) -> Self
Trait Implementations§
Source§impl<'a> Clone for PyroSchema<'a>
impl<'a> Clone for PyroSchema<'a>
Source§fn clone(&self) -> PyroSchema<'a>
fn clone(&self) -> PyroSchema<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for PyroSchema<'a>
impl<'a> Debug for PyroSchema<'a>
Source§impl<'de, 'a> Deserialize<'de> for PyroSchema<'a>
impl<'de, 'a> Deserialize<'de> for PyroSchema<'a>
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> Display for PyroSchema<'a>
impl<'a> Display for PyroSchema<'a>
impl<'a> Eq for PyroSchema<'a>
Source§impl<'a> Hash for PyroSchema<'a>
impl<'a> Hash for PyroSchema<'a>
Source§impl<'a> PartialEq for PyroSchema<'a>
impl<'a> PartialEq for PyroSchema<'a>
Source§fn eq(&self, other: &PyroSchema<'a>) -> bool
fn eq(&self, other: &PyroSchema<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'a> Serialize for PyroSchema<'a>
impl<'a> Serialize for PyroSchema<'a>
impl<'a> StructuralPartialEq for PyroSchema<'a>
Auto Trait Implementations§
impl<'a> Freeze for PyroSchema<'a>
impl<'a> RefUnwindSafe for PyroSchema<'a>
impl<'a> Send for PyroSchema<'a>
impl<'a> Sync for PyroSchema<'a>
impl<'a> Unpin for PyroSchema<'a>
impl<'a> UnsafeUnpin for PyroSchema<'a>
impl<'a> UnwindSafe for PyroSchema<'a>
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
Mutably borrows from an owned value. Read more