pub struct AvpData<T>(/* private fields */);Implementations§
Source§impl AvpData<String>
impl AvpData<String>
Sourcepub fn from_str(value: &'static str) -> Self
pub fn from_str(value: &'static str) -> Self
Examples found in repository?
example/client.rs (line 27)
16fn main() -> DiameterResult<()> {
17 let dict = Arc::new(Dictionary::new(&[&dictionary::DEFAULT_DICT_XML]));
18
19 let mut ccr: DiameterMessage = DiameterMessage::new(
20 CommandFlag::Request,
21 CommandCode::CreditControl,
22 ApplicationId::Gx,
23 1123158611,
24 3102381851,
25 );
26
27 ccr.add(Avp::new(263, M, None, UTF8String::from_str("a")));
28 ccr.add_avp(264, M, None, Identity::from_str("host.example.com"));
29 ccr.add(Avp::new(
30 296,
31 M,
32 None,
33 Identity::from_str("realm.example.com"),
34 ));
35 ccr.add(Avp::new(263, M, None, UTF8String::from_str("ses;12345888")));
36 ccr.add(Avp::new(416, M, None, Enumerated::new(1)));
37 ccr.add(Avp::new(415, M, None, Unsigned32::new(1000)));
38 ccr.add(Avp::new(
39 264,
40 M,
41 None,
42 Identity::from_str("host.example.com"),
43 ));
44 ccr.add(Avp::new(
45 296,
46 M,
47 None,
48 Identity::from_str("realm.example.com"),
49 ));
50 ccr.add(Avp::new(416, M, None, Enumerated::new(1)));
51 ccr.add(Avp::new(415, M, None, Unsigned32::new(1000)));
52
53 let mut client = DiameterClient::new("127.0.0.1:3868");
54 client.connect()?;
55 let cca: DiameterMessage = client.send_message(&mut ccr, dict)?;
56 client.close()?;
57 println!("{:?}", cca);
58 Ok(())
59}Source§impl<T> AvpData<T>
impl<T> AvpData<T>
Sourcepub fn new(data: T) -> Self
pub fn new(data: T) -> Self
Examples found in repository?
example/client.rs (line 36)
16fn main() -> DiameterResult<()> {
17 let dict = Arc::new(Dictionary::new(&[&dictionary::DEFAULT_DICT_XML]));
18
19 let mut ccr: DiameterMessage = DiameterMessage::new(
20 CommandFlag::Request,
21 CommandCode::CreditControl,
22 ApplicationId::Gx,
23 1123158611,
24 3102381851,
25 );
26
27 ccr.add(Avp::new(263, M, None, UTF8String::from_str("a")));
28 ccr.add_avp(264, M, None, Identity::from_str("host.example.com"));
29 ccr.add(Avp::new(
30 296,
31 M,
32 None,
33 Identity::from_str("realm.example.com"),
34 ));
35 ccr.add(Avp::new(263, M, None, UTF8String::from_str("ses;12345888")));
36 ccr.add(Avp::new(416, M, None, Enumerated::new(1)));
37 ccr.add(Avp::new(415, M, None, Unsigned32::new(1000)));
38 ccr.add(Avp::new(
39 264,
40 M,
41 None,
42 Identity::from_str("host.example.com"),
43 ));
44 ccr.add(Avp::new(
45 296,
46 M,
47 None,
48 Identity::from_str("realm.example.com"),
49 ));
50 ccr.add(Avp::new(416, M, None, Enumerated::new(1)));
51 ccr.add(Avp::new(415, M, None, Unsigned32::new(1000)));
52
53 let mut client = DiameterClient::new("127.0.0.1:3868");
54 client.connect()?;
55 let cca: DiameterMessage = client.send_message(&mut ccr, dict)?;
56 client.close()?;
57 println!("{:?}", cca);
58 Ok(())
59}pub fn value(&self) -> &T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AvpData<T>where
T: Freeze,
impl<T> RefUnwindSafe for AvpData<T>where
T: RefUnwindSafe,
impl<T> Send for AvpData<T>where
T: Send,
impl<T> Sync for AvpData<T>where
T: Sync,
impl<T> Unpin for AvpData<T>where
T: Unpin,
impl<T> UnwindSafe for AvpData<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more