#![allow(missing_copy_implementations)]
use raw;
pub struct Time {
time: i64,
offset: int,
}
pub struct IndexTime {
seconds: i64,
nanoseconds: u32,
}
impl Time {
pub fn new(time: i64, offset: int) -> Time {
Time { time: time, offset: offset }
}
pub fn from_raw(raw: &raw::git_time) -> Time {
Time::new(raw.time as i64, raw.offset as int)
}
pub fn seconds(&self) -> i64 { self.time }
pub fn offset_minutes(&self) -> int { self.offset }
}
impl IndexTime {
pub fn new(seconds: i64, nanoseconds: u32) -> IndexTime {
IndexTime { seconds: seconds, nanoseconds: nanoseconds }
}
pub fn from_raw(raw: &raw::git_index_time) -> IndexTime {
IndexTime::new(raw.seconds as i64, raw.nanoseconds as u32)
}
pub fn seconds(&self) -> i64 { self.seconds }
pub fn nanoseconds(&self) -> u32 { self.nanoseconds }
}