fusion-common 0.1.0

A data fusion platform with scheduler, ai agent studio and core libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
use uuid::Uuid;

use super::Error;

pub fn from_vec_u8(decoded_bytes: Vec<u8>, error_context: &'static str) -> Result<Uuid, Error> {
  let bytes_array: [u8; 16] = decoded_bytes
    .try_into()
    .map_err(|ex: Vec<u8>| Error::FailToDecode16U8 { context: error_context, actual_length: ex.len() })?;

  Ok(Uuid::from_bytes(bytes_array))
}