Derives a [`SourceInfoSchema`] from SRCINFO data in a `reader`. Reads the `reader` to string and defers to [`SourceInfoSchema::derive_from_str`]. # Errors Returns an error if - reading a [`String`] from `reader` fails - or deriving a [`SourceInfoSchema`] from the contents of `reader` fails.
(reader: impl std::io::Read)
| 69 | /// - reading a [`String`] from `reader` fails |
| 70 | /// - or deriving a [`SourceInfoSchema`] from the contents of `reader` fails. |
| 71 | fn derive_from_reader(reader: impl std::io::Read) -> Result<Self, Error> |
| 72 | where |
| 73 | Self: Sized, |
| 74 | { |
| 75 | let mut buf = String::new(); |
| 76 | let mut reader = reader; |
| 77 | reader |
| 78 | .read_to_string(&mut buf) |
| 79 | .map_err(|source| Error::Io { |
| 80 | context: t!("error-io-deriving-schema-from-srcinfo-data"), |
| 81 | source, |
| 82 | })?; |
| 83 | Self::derive_from_str(&buf) |
| 84 | } |
| 85 | |
| 86 | /// Derives a [`SourceInfoSchema`] from a string slice containing SRCINFO data. |
| 87 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected