Skip to content

Commit 47bb097

Browse files
committed
gio: implement output stream writev methods
1 parent 3a880a9 commit 47bb097

File tree

5 files changed

+474
-101
lines changed

5 files changed

+474
-101
lines changed

gio/Gir.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,11 @@ manual_traits = ["OutputStreamExtManual"]
10461046
# special return value
10471047
manual = true
10481048
doc_trait_name = "OutputStreamExtManual"
1049+
[[object.function]]
1050+
pattern = "writev.*"
1051+
# OutputVector
1052+
manual = true
1053+
doc_trait_name = "OutputStreamExtManual"
10491054

10501055
[[object]]
10511056
name = "Gio.PollableInputStream"
@@ -1071,6 +1076,11 @@ manual_traits = ["PollableOutputStreamExtManual"]
10711076
# manual source implementation
10721077
manual = true
10731078
doc_trait_name = "PollableOutputStreamExtManual"
1079+
[[object.function]]
1080+
name = "writev_nonblocking"
1081+
# OutputVector
1082+
manual = true
1083+
doc_trait_name = "PollableOutputStreamExtManual"
10741084

10751085
[[object]]
10761086
name = "Gio.PowerProfileMonitor"

gio/src/auto/output_stream.rs

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -134,36 +134,6 @@ pub trait OutputStreamExt: 'static {
134134
bytes: &glib::Bytes,
135135
io_priority: glib::Priority,
136136
) -> Pin<Box_<dyn std::future::Future<Output = Result<isize, glib::Error>> + 'static>>;
137-
138-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
139-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
140-
//#[doc(alias = "g_output_stream_writev")]
141-
//fn writev(&self, vectors: /*Ignored*/&[OutputVector], cancellable: Option<&impl IsA<Cancellable>>) -> Result<usize, glib::Error>;
142-
143-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
144-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
145-
//#[doc(alias = "g_output_stream_writev_all")]
146-
//fn writev_all(&self, vectors: /*Ignored*/&[OutputVector], cancellable: Option<&impl IsA<Cancellable>>) -> Result<usize, glib::Error>;
147-
148-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
149-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
150-
//#[doc(alias = "g_output_stream_writev_all_async")]
151-
//fn writev_all_async<P: FnOnce(Result<usize, glib::Error>) + 'static>(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P);
152-
153-
//
154-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
155-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
156-
//fn writev_all_future(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority) -> Pin<Box_<dyn std::future::Future<Output = Result<usize, glib::Error>> + 'static>>;
157-
158-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
159-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
160-
//#[doc(alias = "g_output_stream_writev_async")]
161-
//fn writev_async<P: FnOnce(Result<usize, glib::Error>) + 'static>(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P);
162-
163-
//
164-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
165-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
166-
//fn writev_future(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority) -> Pin<Box_<dyn std::future::Future<Output = Result<usize, glib::Error>> + 'static>>;
167137
}
168138

169139
impl<O: IsA<OutputStream>> OutputStreamExt for O {
@@ -583,66 +553,6 @@ impl<O: IsA<OutputStream>> OutputStreamExt for O {
583553
},
584554
))
585555
}
586-
587-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
588-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
589-
//fn writev(&self, vectors: /*Ignored*/&[OutputVector], cancellable: Option<&impl IsA<Cancellable>>) -> Result<usize, glib::Error> {
590-
// unsafe { TODO: call ffi:g_output_stream_writev() }
591-
//}
592-
593-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
594-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
595-
//fn writev_all(&self, vectors: /*Ignored*/&[OutputVector], cancellable: Option<&impl IsA<Cancellable>>) -> Result<usize, glib::Error> {
596-
// unsafe { TODO: call ffi:g_output_stream_writev_all() }
597-
//}
598-
599-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
600-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
601-
//fn writev_all_async<P: FnOnce(Result<usize, glib::Error>) + 'static>(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P) {
602-
// unsafe { TODO: call ffi:g_output_stream_writev_all_async() }
603-
//}
604-
605-
//
606-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
607-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
608-
//fn writev_all_future(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority) -> Pin<Box_<dyn std::future::Future<Output = Result<usize, glib::Error>> + 'static>> {
609-
610-
//let vectors = vectors.clone();
611-
//Box_::pin(crate::GioFuture::new(self, move |obj, cancellable, send| {
612-
// obj.writev_all_async(
613-
// &vectors,
614-
// io_priority,
615-
// Some(cancellable),
616-
// move |res| {
617-
// send.resolve(res);
618-
// },
619-
// );
620-
//}))
621-
//}
622-
623-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
624-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
625-
//fn writev_async<P: FnOnce(Result<usize, glib::Error>) + 'static>(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority, cancellable: Option<&impl IsA<Cancellable>>, callback: P) {
626-
// unsafe { TODO: call ffi:g_output_stream_writev_async() }
627-
//}
628-
629-
//
630-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
631-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
632-
//fn writev_future(&self, vectors: /*Ignored*/&[OutputVector], io_priority: glib::Priority) -> Pin<Box_<dyn std::future::Future<Output = Result<usize, glib::Error>> + 'static>> {
633-
634-
//let vectors = vectors.clone();
635-
//Box_::pin(crate::GioFuture::new(self, move |obj, cancellable, send| {
636-
// obj.writev_async(
637-
// &vectors,
638-
// io_priority,
639-
// Some(cancellable),
640-
// move |res| {
641-
// send.resolve(res);
642-
// },
643-
// );
644-
//}))
645-
//}
646556
}
647557

648558
impl fmt::Display for OutputStream {

gio/src/auto/pollable_output_stream.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ pub trait PollableOutputStreamExt: 'static {
3535
buffer: &[u8],
3636
cancellable: Option<&impl IsA<Cancellable>>,
3737
) -> Result<isize, glib::Error>;
38-
39-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
40-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
41-
//#[doc(alias = "g_pollable_output_stream_writev_nonblocking")]
42-
//fn writev_nonblocking(&self, vectors: /*Ignored*/&[OutputVector], cancellable: Option<&impl IsA<Cancellable>>) -> Result<(/*Ignored*/PollableReturn, usize), glib::Error>;
4338
}
4439

4540
impl<O: IsA<PollableOutputStream>> PollableOutputStreamExt for O {
@@ -81,12 +76,6 @@ impl<O: IsA<PollableOutputStream>> PollableOutputStreamExt for O {
8176
}
8277
}
8378
}
84-
85-
//#[cfg(any(feature = "v2_60", feature = "dox"))]
86-
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
87-
//fn writev_nonblocking(&self, vectors: /*Ignored*/&[OutputVector], cancellable: Option<&impl IsA<Cancellable>>) -> Result<(/*Ignored*/PollableReturn, usize), glib::Error> {
88-
// unsafe { TODO: call ffi:g_pollable_output_stream_writev_nonblocking() }
89-
//}
9079
}
9180

9281
impl fmt::Display for PollableOutputStream {

0 commit comments

Comments
 (0)