Expand description
A mutable signature is created by an actor at a certain time.
Note that this is not a cryptographical signature.
Fields§
§name: BString
The actors name.
email: BString
The actor’s email.
time: Time
The time stamp at which the signature is performed.
Implementations§
source§impl Signature
impl Signature
sourcepub fn to_ref(&self) -> SignatureRef<'_>
pub fn to_ref(&self) -> SignatureRef<'_>
Borrow this instance as immutable
Examples found in repository?
src/signature/mod.rs (line 72)
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
fn from(other: &'a Signature) -> SignatureRef<'a> {
other.to_ref()
}
}
}
mod write {
use std::io;
use bstr::{BStr, ByteSlice};
use quick_error::quick_error;
use crate::{Signature, SignatureRef};
quick_error! {
/// The Error produced by [`Signature::write_to()`].
#[derive(Debug)]
#[allow(missing_docs)]
enum Error {
IllegalCharacter {
display("Signature name or email must not contain '<', '>' or \\n")
}
}
}
impl From<Error> for io::Error {
fn from(err: Error) -> Self {
io::Error::new(io::ErrorKind::Other, err)
}
}
/// Output
impl Signature {
/// Serialize this instance to `out` in the git serialization format for actors.
pub fn write_to(&self, out: impl io::Write) -> io::Result<()> {
self.to_ref().write_to(out)
}
/// Computes the number of bytes necessary to serialize this signature
pub fn size(&self) -> usize {
self.to_ref().size()
}
Trait Implementations§
source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<&'a Signature> for SignatureRef<'a>
impl<'a> From<&'a Signature> for SignatureRef<'a>
source§fn from(other: &'a Signature) -> SignatureRef<'a>
fn from(other: &'a Signature) -> SignatureRef<'a>
Converts to this type from the input type.
source§impl From<SignatureRef<'_>> for Signature
impl From<SignatureRef<'_>> for Signature
source§fn from(other: SignatureRef<'_>) -> Signature
fn from(other: SignatureRef<'_>) -> Signature
Converts to this type from the input type.
source§impl Ord for Signature
impl Ord for Signature
source§impl PartialEq<Signature> for Signature
impl PartialEq<Signature> for Signature
source§impl PartialOrd<Signature> for Signature
impl PartialOrd<Signature> for Signature
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more