Reads the file at `path` and deserializes a plan from the bytes.
(path: impl AsRef<Path>)
| 65 | |
| 66 | /// Reads the file at `path` and deserializes a plan from the bytes. |
| 67 | pub async fn deserialize(path: impl AsRef<Path>) -> Result<Box<Plan>> { |
| 68 | let mut protobuf_in = Vec::<u8>::new(); |
| 69 | |
| 70 | let mut file = OpenOptions::new().read(true).open(path).await?; |
| 71 | file.read_to_end(&mut protobuf_in).await?; |
| 72 | |
| 73 | deserialize_bytes(protobuf_in).await |
| 74 | } |
| 75 | |
| 76 | /// Deserializes a plan from the bytes. |
| 77 | pub async fn deserialize_bytes(proto_bytes: Vec<u8>) -> Result<Box<Plan>> { |
searching dependent graphs…