summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet_pile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/packet_pile.rs')
-rw-r--r--openpgp/src/packet_pile.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/packet_pile.rs b/openpgp/src/packet_pile.rs
index e14a541d..275c0dba 100644
--- a/openpgp/src/packet_pile.rs
+++ b/openpgp/src/packet_pile.rs
@@ -64,6 +64,14 @@ impl<'a> Parse<'a, PacketPile> for PacketPile {
}
}
+impl std::str::FromStr for PacketPile {
+ type Err = failure::Error;
+
+ fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
+ Self::from_bytes(s.as_bytes())
+ }
+}
+
impl From<Vec<Packet>> for PacketPile {
fn from(p: Vec<Packet>) -> Self {
PacketPile { top_level: Container { packets: p } }