pub fn try_push<T: AsRef<str>>(&mut self, value: Option<T>) -> Result<()> {
        match value {
            Some(value) => {
                let bytes = value.as_ref().as_bytes();
                self.values.extend_from_slice(bytes);

                let size = O::from_usize(self.values.len()).ok_or(ArrowError::KeyOverflowError)?;

                self.offsets.push(size);

                match &mut self.validity {
                    Some(validity) => validity.push(true),
                    None => {}
                }
            }
            None => {
                self.offsets.push(self.last_offset());
                match &mut self.validity {
                    Some(validity) => validity.push(false),
                    None => self.init_validity(),
                }
            }
        }
        Ok(())
    }
/// Tries to push a new element to the array.
/// # Error
/// This operation errors iff the length of all values (in bytes) exceeds `O` maximum value.
Tries to push a new element to the array.
Tries to push a new element to the array .
pub fn try_push<T: AsRef<str>>(&mut self, value: Option<T>) -> Result<()> {
        match value {
            Some(value) => {
                let bytes = value.as_ref().as_bytes();
                self.values.extend_from_slice(bytes);
                let size = O::from_usize(self.values.len()).ok_or(ArrowError::KeyOverflowError)?;
                self.offsets.push(size);
                match &mut self.validity {
                    Some(validity) => validity.push(true),
                    None => {}
                }
            }
            None => {
                self.offsets.push(self.last_offset());
                match &mut self.validity {
                    Some(validity) => validity.push(false),
                    None => self.init_validity(),
                }
            }
        }
        Ok(())
    }
pub fn try_push < T : AsRef < str > > ( & mut self , value : Option < T > ) -> Result < ( ) > { match value { Some ( value ) => { let bytes = value . as_ref ( ) . as_bytes ( ) ; self . values . extend_from_slice ( bytes ) ; let size = O :: from_usize ( self . values . len ( ) ) . ok_or ( ArrowError :: KeyOverflowError ) ? ; self . offsets . push ( size ) ; match & mut self . validity { Some ( validity ) => validity . push ( true ) , None => { } } } None => { self . offsets . push ( self . last_offset ( ) ) ; match & mut self . validity { Some ( validity ) => validity . push ( false ) , None => self . init_validity ( ) , } } } Ok ( ( ) ) }
Tries to push a new element to the array.
Tries to push a new element to the array .
&mut self
value
Option<T>
error
This operation errors iff the length of all values (in bytes) exceeds `O` maximum value.
This operation errors iff the length of all values ( in bytes ) exceeds ` O ` maximum value .