Struct git2::Signature [−][src]
pub struct Signature<'a> { /* fields omitted */ }Expand description
A Signature is used to indicate authorship of various actions throughout the library.
Signatures contain a name, email, and timestamp. All fields can be specified
with new while the now constructor omits the timestamp. The
Repository::signature method can be used to create a default signature
with name and email values read from the configuration.
Implementations
impl<'a> Signature<'a>[src]
impl<'a> Signature<'a>[src]pub fn now(name: &str, email: &str) -> Result<Signature<'static>, Error>[src]
pub fn now(name: &str, email: &str) -> Result<Signature<'static>, Error>[src]Create a new action signature with a timestamp of ‘now’.
See new for more information
pub fn new(
name: &str,
email: &str,
time: &Time
) -> Result<Signature<'static>, Error>[src]
pub fn new(
name: &str,
email: &str,
time: &Time
) -> Result<Signature<'static>, Error>[src]Create a new action signature.
The time specified is in seconds since the epoch, and the offset is
the time zone offset in minutes.
Returns error if either name or email contain angle brackets.
pub fn name(&self) -> Option<&str>[src]
pub fn name(&self) -> Option<&str>[src]Gets the name on the signature.
Returns None if the name is not valid utf-8
pub fn name_bytes(&self) -> &[u8]ⓘ[src]
pub fn name_bytes(&self) -> &[u8]ⓘ[src]Gets the name on the signature as a byte slice.
pub fn email(&self) -> Option<&str>[src]
pub fn email(&self) -> Option<&str>[src]Gets the email on the signature.
Returns None if the email is not valid utf-8
pub fn email_bytes(&self) -> &[u8]ⓘ[src]
pub fn email_bytes(&self) -> &[u8]ⓘ[src]Gets the email on the signature as a byte slice.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Signature<'a>
impl<'a> !Send for Signature<'a>
impl<'a> !Sync for Signature<'a>
impl<'a> Unpin for Signature<'a>
impl<'a> UnwindSafe for Signature<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more