pub struct SnapshotSourceMetadata<'a> {
pub path: Option<&'a str>,
pub locale: Option<&'a str>,
pub message_id: Option<&'a str>,
pub base_offset: Option<u32>,
}Expand description
Snapshot source metadata that pairs with
parse_message_to_snapshot’s source parameter.
Deliberately omits the source field that
SourceFileInput carries: the snapshot writer must point at
the same bytes the parser saw, and a metadata struct that owned
its own source would invite the caller to set two different
strings. Bindings and language wrappers should follow the same
shape.
Fields§
§path: Option<&'a str>Optional filesystem path, used for diagnostics.
locale: Option<&'a str>Optional BCP-47 locale tag, used for project-aware tooling.
message_id: Option<&'a str>Optional logical message id (e.g. translation key).
base_offset: Option<u32>Optional base offset, used when the source is a substring of a larger file (e.g. a single entry inside a locale resource).
Trait Implementations§
Source§impl<'a> Clone for SnapshotSourceMetadata<'a>
impl<'a> Clone for SnapshotSourceMetadata<'a>
Source§fn clone(&self) -> SnapshotSourceMetadata<'a>
fn clone(&self) -> SnapshotSourceMetadata<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for SnapshotSourceMetadata<'a>
Source§impl<'a> Debug for SnapshotSourceMetadata<'a>
impl<'a> Debug for SnapshotSourceMetadata<'a>
Source§impl<'a> Default for SnapshotSourceMetadata<'a>
impl<'a> Default for SnapshotSourceMetadata<'a>
Source§fn default() -> SnapshotSourceMetadata<'a>
fn default() -> SnapshotSourceMetadata<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for SnapshotSourceMetadata<'a>
impl<'a> RefUnwindSafe for SnapshotSourceMetadata<'a>
impl<'a> Send for SnapshotSourceMetadata<'a>
impl<'a> Sync for SnapshotSourceMetadata<'a>
impl<'a> Unpin for SnapshotSourceMetadata<'a>
impl<'a> UnsafeUnpin for SnapshotSourceMetadata<'a>
impl<'a> UnwindSafe for SnapshotSourceMetadata<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more