Struct git2::Signature [] [src]

pub struct Signature<'a> {
    // some 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, the now constructor omits the timestamp, and the default constructor reads configuration from the given repository.

Methods

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

fn now(name: &str, email: &str) -> Result<Signature<'static>, Error>

Create a new action signature with a timestamp of 'now'.

See new for more information

fn new(name: &str, email: &str, time: &Time) -> Result<Signature<'static>, Error>

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.

fn name(&self) -> Option<&str>

Gets the name on the signature.

Returns None if the name is not valid utf-8

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

Gets the name on the signature as a byte slice.

fn email(&self) -> Option<&str>

Gets the email on the signature.

Returns None if the email is not valid utf-8

fn email_bytes(&self) -> &[u8]

Gets the email on the signature as a byte slice.

fn when(&self) -> Time

Get the when of this signature.

fn to_owned(&self) -> Signature<'static>

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

Trait Implementations

impl Clone for Signature<'static>
[src]

fn clone(&self) -> Signature<'static>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

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

fn drop(&mut self)

A method called when the value goes out of scope. Read more

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

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.