Expand description
This crate provides ways of identifying an actor within the git repository both in shared and mutable variants.
§Examples
use gix_actor::{IdentityRef, SignatureRef};
let actor = IdentityRef::from_bytes::<()>(b" Taylor Example < taylor@example.com >")
.unwrap()
.trim();
assert_eq!(actor.name, "Taylor Example");
assert_eq!(actor.email, "taylor@example.com");
let signature = SignatureRef::from_bytes::<()>(b"Taylor Example <taylor@example.com> 1711398853 +0800")
.unwrap()
.trim();
assert_eq!(signature.actor(), actor);
let time = signature.time().unwrap();
assert_eq!(time.seconds, 1_711_398_853);
assert_eq!(time.offset, 8 * 60 * 60);
let owned = signature.to_owned().unwrap();
let mut out = Vec::new();
owned.write_to(&mut out).unwrap();
assert_eq!(out, b"Taylor Example <taylor@example.com> 1711398853 +0800");§Feature Flags
serde— Data structures implementserde::Serializeandserde::Deserialize.
Re-exports§
Modules§
Structs§
- Identity
- A person with name and email.
- Identity
Ref - A person with name and email, as reference.
- Signature
- A mutable signature that is created by an actor at a certain time.
- Signature
Ref - An immutable signature that is created by an actor at a certain time.