Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Data / Stream / Bulk / Nil.pm
1 #!/usr/bin/perl
2
3 package Data::Stream::Bulk::Nil;
4 use Moose;
5
6 use namespace::clean -except => 'meta';
7
8 with qw(Data::Stream::Bulk) => { excludes => [qw/loaded filter list_cat all items/] };
9
10 sub items { return () }
11
12 sub all { return () }
13
14 sub next { undef }
15
16 sub is_done { 1 }
17
18 sub list_cat {
19         my ( $self, $head, @rest ) = @_;
20
21         return () unless $head;
22         return $head->list_cat(@rest);
23 }
24
25 sub filter { return $_[0] };
26
27 sub loaded { 1 }
28
29 __PACKAGE__->meta->make_immutable;
30
31 __PACKAGE__
32
33 __END__
34
35 =pod
36
37 =head1 NAME
38
39 Data::Stream::Bulk::Nil - An empty L<Data::Stream::Bulk> iterator
40
41 =head1 SYNOPSIS
42
43         return Data::Stream::Bulk::Nil->new; # empty set
44
45 =head1 DESCRIPTION
46
47 This iterator can be used to return the empty resultset.
48
49 =head1 METHODS
50
51 =over 4
52
53 =item is_done
54
55 Always returns true.
56
57 =item next
58
59 Always returns undef.
60
61 =item items
62
63 =item all
64
65 Always returns the empty list.
66
67 =item list_cat
68
69 Skips $self
70
71 =item filter
72
73 Returns $self
74
75 =item loaded
76
77 Returns true.
78
79 =back
80
81 =cut
82