fidl_data_zx/
stream.rs

1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// DO NOT EDIT.
6// Generated from FIDL library `zx` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use zerocopy::IntoBytes;
11
12use crate::zx_common::*;
13
14#[repr(u32)]
15#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
16pub enum StreamSeekOrigin {
17    Start = 0,
18    Current = 1,
19    End = 2,
20}
21
22impl StreamSeekOrigin {
23    pub fn from_raw(raw: u32) -> Option<Self> {
24        match raw {
25            0 => Some(Self::Start),
26
27            1 => Some(Self::Current),
28
29            2 => Some(Self::End),
30
31            _ => None,
32        }
33    }
34}
35
36#[repr(C)]
37#[derive(Clone, Copy, Debug, Eq, PartialEq)]
38pub struct Iovec {
39    pub buffer: *const u8,
40    pub capacity: usize,
41}