summaryrefslogtreecommitdiff
path: root/cli/msg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/msg.rs')
-rw-r--r--cli/msg.rs85
1 files changed, 79 insertions, 6 deletions
diff --git a/cli/msg.rs b/cli/msg.rs
index db4c771f8..4416c7d71 100644
--- a/cli/msg.rs
+++ b/cli/msg.rs
@@ -1,8 +1,81 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-#![allow(dead_code)]
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::all, clippy::pedantic))]
-use flatbuffers;
-// GN_OUT_DIR is set either by build.rs (for the Cargo build), or by
-// build_extra/rust/run.py (for the GN+Ninja build).
-include!(concat!(env!("GN_OUT_DIR"), "/gen/cli/msg_generated.rs"));
+// Warning! The values in this enum are duplicated in js/errors.ts
+// Update carefully!
+#[allow(non_camel_case_types)]
+#[repr(i8)]
+#[derive(Clone, Copy, PartialEq, Debug)]
+pub enum ErrorKind {
+ NoError = 0,
+ NotFound = 1,
+ PermissionDenied = 2,
+ ConnectionRefused = 3,
+ ConnectionReset = 4,
+ ConnectionAborted = 5,
+ NotConnected = 6,
+ AddrInUse = 7,
+ AddrNotAvailable = 8,
+ BrokenPipe = 9,
+ AlreadyExists = 10,
+ WouldBlock = 11,
+ InvalidInput = 12,
+ InvalidData = 13,
+ TimedOut = 14,
+ Interrupted = 15,
+ WriteZero = 16,
+ Other = 17,
+ UnexpectedEof = 18,
+ BadResource = 19,
+ CommandFailed = 20,
+ EmptyHost = 21,
+ IdnaError = 22,
+ InvalidPort = 23,
+ InvalidIpv4Address = 24,
+ InvalidIpv6Address = 25,
+ InvalidDomainCharacter = 26,
+ RelativeUrlWithoutBase = 27,
+ RelativeUrlWithCannotBeABaseBase = 28,
+ SetHostOnCannotBeABaseUrl = 29,
+ Overflow = 30,
+ HttpUser = 31,
+ HttpClosed = 32,
+ HttpCanceled = 33,
+ HttpParse = 34,
+ HttpOther = 35,
+ TooLarge = 36,
+ InvalidUri = 37,
+ InvalidSeekMode = 38,
+ OpNotAvailable = 39,
+ WorkerInitFailed = 40,
+ UnixError = 41,
+ NoAsyncSupport = 42,
+ NoSyncSupport = 43,
+ ImportMapError = 44,
+ InvalidPath = 45,
+ ImportPrefixMissing = 46,
+ UnsupportedFetchScheme = 47,
+ TooManyRedirects = 48,
+ Diagnostic = 49,
+ JSError = 50,
+}
+
+// Warning! The values in this enum are duplicated in js/compiler.ts
+// Update carefully!
+#[allow(non_camel_case_types)]
+#[repr(i8)]
+#[derive(Clone, Copy, PartialEq, Debug)]
+pub enum MediaType {
+ JavaScript = 0,
+ TypeScript = 1,
+ Json = 2,
+ Unknown = 3,
+}
+
+pub fn enum_name_media_type(mt: MediaType) -> &'static str {
+ match mt {
+ MediaType::JavaScript => "JavaScript",
+ MediaType::TypeScript => "TypeScript",
+ MediaType::Json => "Json",
+ MediaType::Unknown => "Unknown",
+ }
+}