MCPcopy Create free account
hub / github.com/apache/arrow-rs / unpack

Method unpack

arrow-flight/src/sql/mod.rs:311–318  ·  view source on GitHub ↗

Unpacks the contents of the message if it is of type `M`

(&self)

Source from the content-addressed store, hash-verified

309
310 /// Unpacks the contents of the message if it is of type `M`
311 pub fn unpack<M: ProstMessageExt>(&self) -> Result<Option<M>, ArrowError> {
312 if !self.is::<M>() {
313 return Ok(None);
314 }
315 let m = Message::decode(&*self.value)
316 .map_err(|err| ArrowError::ParseError(format!("Unable to decode Any value: {err}")))?;
317 Ok(Some(m))
318 }
319
320 /// Packs a message into an [`Any`] message
321 pub fn pack<M: ProstMessageExt>(message: &M) -> Result<Any, ArrowError> {

Callers 4

do_actionMethod · 0.80
prepareMethod · 0.80
begin_transactionMethod · 0.80

Calls 1

decodeFunction · 0.50

Tested by 1