diff options
author | cel 🌸 <cel@blos.sm> | 2023-10-21 01:28:54 +0100 |
---|---|---|
committer | cel 🌸 <cel@blos.sm> | 2023-10-21 01:28:54 +0100 |
commit | e893869df974ebb7afcc318119840c53f8f377cb (patch) | |
tree | 3319dba477784c126011acc5422c9973782f7850 /src/stanza/stream.rs | |
parent | ba94ee66fafbabd63d6d1ed5edf435d4c46c6796 (diff) | |
download | luz-e893869df974ebb7afcc318119840c53f8f377cb.tar.gz luz-e893869df974ebb7afcc318119840c53f8f377cb.tar.bz2 luz-e893869df974ebb7afcc318119840c53f8f377cb.zip |
implement connection
Diffstat (limited to '')
-rw-r--r-- | src/stanza/stream.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/stanza/stream.rs b/src/stanza/stream.rs index 07f7e6e..9a21373 100644 --- a/src/stanza/stream.rs +++ b/src/stanza/stream.rs @@ -25,13 +25,13 @@ pub struct Stream<'s> { xmlns_stream: &'s str, } -impl Stream { +impl<'s> Stream<'s> { pub fn new( - from: Option<&JID>, - to: Option<&JID>, - id: Option<&str>, - version: Option<&str>, - lang: Option<&str>, + from: Option<&'s JID>, + to: Option<&'s JID>, + id: Option<&'s str>, + version: Option<&'s str>, + lang: Option<&'s str>, ) -> Self { Self { from, @@ -46,7 +46,12 @@ impl Stream { /// For initial stream headers, the initiating entity SHOULD include the 'xml:lang' attribute. /// For privacy, it is better to not set `from` when sending a client stanza over an unencrypted connection. - pub fn new_client(from: Option<&JID>, to: &JID, id: Option<&str>, lang: &str) -> Self { + pub fn new_client( + from: Option<&'s JID>, + to: &'s JID, + id: Option<&'s str>, + lang: &'s str, + ) -> Self { Self { from, to: Some(to), |