File Coverage

blib/lib/Sys/Async/Virt/Interface.pm
Criterion Covered Total %
statement 26 63 41.2
branch n/a
condition 0 4 0.0
subroutine 9 18 50.0
pod 7 9 77.7
total 42 94 44.6


line stmt bran cond sub pod time code
1             ####################################################################
2             #
3             # This file was generated using XDR::Parse version v1.0.1
4             # and LibVirt version v12.1.0
5             #
6             # Don't edit this file, use the source template instead
7             #
8             # ANY CHANGES HERE WILL BE LOST !
9             #
10             ####################################################################
11              
12              
13 1     1   12 use v5.26;
  1         4  
14 1     1   4 use warnings;
  1         2  
  1         45  
15 1     1   3 use experimental 'signatures';
  1         1  
  1         5  
16 1     1   123 use Future::AsyncAwait;
  1         3  
  1         5  
17 1     1   50 use Object::Pad;
  1         3  
  1         5  
18              
19             class Sys::Async::Virt::Interface v0.6.1;
20              
21 1     1   294 use Carp qw(croak);
  1         2  
  1         76  
22 1     1   6 use Log::Any qw($log);
  1         2  
  1         8  
23              
24 1     1   169 use Protocol::Sys::Virt::Remote::XDR v12.1.0;
  1         10  
  1         81  
25             my $remote = 'Protocol::Sys::Virt::Remote::XDR';
26              
27             use constant {
28 1         1963 XML_INACTIVE => 1 << 0,
29 1     1   10 };
  1         2  
30              
31              
32 0     0 0   field $_rpc_id :param :reader;
  0            
33 0     0 0   field $_client :param :reader;
  0            
34              
35 0     0 1   method name() {
  0            
  0            
36 0           return $_rpc_id->{name};
37             }
38              
39 0     0 1   method mac() {
  0            
  0            
40 0           return $_rpc_id->{mac};
41             }
42              
43 0     0 1   method create($flags = 0) {
  0            
  0            
  0            
44 0   0       return $_client->_call(
45             $remote->PROC_INTERFACE_CREATE,
46             { iface => $_rpc_id, flags => $flags // 0 }, empty => 1 );
47             }
48              
49 0     0 1   method destroy($flags = 0) {
  0            
  0            
  0            
50 0   0       return $_client->_call(
51             $remote->PROC_INTERFACE_DESTROY,
52             { iface => $_rpc_id, flags => $flags // 0 }, empty => 1 );
53             }
54              
55 0     0 1   async method get_xml_desc($flags = 0) {
  0            
  0            
  0            
  0            
56 0           return await $_client->_call(
57             $remote->PROC_INTERFACE_GET_XML_DESC,
58             { iface => $_rpc_id, flags => $flags // 0 }, unwrap => 'xml' );
59             }
60              
61 0     0 1   async method is_active() {
  0            
  0            
  0            
62 0           return await $_client->_call(
63             $remote->PROC_INTERFACE_IS_ACTIVE,
64             { iface => $_rpc_id }, unwrap => 'active' );
65             }
66              
67 0     0 1   method undefine() {
  0            
  0            
68 0           return $_client->_call(
69             $remote->PROC_INTERFACE_UNDEFINE,
70             { iface => $_rpc_id }, empty => 1 );
71             }
72              
73              
74              
75             1;
76              
77              
78             __END__