Skip to content

Commit e3f5e3c

Browse files
committed
Add missing OID documentation
1 parent aebe617 commit e3f5e3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/oid.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern {
3030
fn gethostname(name: *mut libc::c_char, size: libc::size_t) -> libc::c_int;
3131
}
3232

33+
/// Errors that can occur during OID construction and generation.
3334
#[derive(Debug)]
3435
pub enum Error {
3536
ArgumentError(String),
@@ -50,6 +51,7 @@ impl From<io::Error> for Error {
5051
}
5152
}
5253

54+
/// Alias for Result<T, oid::Error>.
5355
pub type Result<T> = result::Result<T, Error>;
5456

5557
impl fmt::Display for Error {
@@ -83,6 +85,7 @@ impl error::Error for Error {
8385
}
8486
}
8587

88+
/// A wrapper around raw 12-byte ObjectId representations.
8689
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord)]
8790
pub struct ObjectId {
8891
id: [u8; 12],
@@ -107,6 +110,7 @@ impl ObjectId {
107110
Ok(ObjectId::with_bytes(buf))
108111
}
109112

113+
/// Constructs a new ObjectId wrapper around the raw byte representation.
110114
pub fn with_bytes(bytes: [u8; 12]) -> ObjectId {
111115
ObjectId {
112116
id: bytes,
@@ -136,6 +140,7 @@ impl ObjectId {
136140
ObjectId::with_bytes(buf)
137141
}
138142

143+
/// Returns the raw byte representation of an ObjectId.
139144
pub fn bytes(&self) -> [u8; 12] {
140145
self.id
141146
}

0 commit comments

Comments
 (0)