[][src]Struct git2::Signature

pub struct Signature<'a> { /* fields omitted */ }

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.

Methods

impl<'a> Signature<'a>[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]

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]

Gets the name on the signature.

Returns None if the name is not valid utf-8

pub fn name_bytes(&self) -> &[u8][src]

Gets the name on the signature as a byte slice.

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]

Gets the email on the signature as a byte slice.

pub fn when(&self) -> Time[src]

Get the when of this signature.

pub fn to_owned(&self) -> Signature<'static>[src]

Convert a signature of any lifetime into an owned signature with a static lifetime.

Trait Implementations

impl<'a> Drop for Signature<'a>[src]

impl Clone for Signature<'static>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Display for Signature<'a>[src]

Auto Trait Implementations

impl<'a> !Send for Signature<'a>

impl<'a> !Sync for Signature<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]