Crate deno_core

source ·

Re-exports

Modules

Macros

  • Include a fast string in the binary from a string literal. This string is asserted at compile-time to be 7-bit ASCII for optimal v8 performance.
  • Defines a Deno extension. The first parameter is the name of the extension symbol namespace to create. This is the symbol you will use to refer to the extension.
  • Include a fast string in the binary. This string is asserted at compile-time to be 7-bit ASCII for optimal v8 performance.
  • Helps embed JS files in an extension. Returns a vector of ExtensionFileSource, that represent the filename and source code. All specified files are rewritten into “ext:<extension_name>/<file_name>”.
  • A helper macro that will return a call site in Rust code. Should be used when executing internal one-line scripts for JsRuntime lifecycle.
  • Declares a block of Deno #[op]s. The first parameter determines the name of the op declaration block, and is usually deno_ops. This block generates a function that returns a Vec<OpDecl>.

Structs

  • BufMutView is a wrapper around an underlying contiguous chunk of writable bytes. It can be created from a ZeroCopyBuf or a Vec<u8> and implements DerefMut<[u8]> and AsMut<[u8]>.
  • BufView is a wrapper around an underlying contiguous chunk of bytes. It can be created from a ZeroCopyBuf, bytes::Bytes, or Vec and implements Deref<[u8]> and AsRef<[u8]>.
  • Basic file system module loader.
  • Encapsulates an UnboundedSender/UnboundedReceiver pair that together form a duplex channel for sending/receiving messages in V8 session.
  • A representation of a JavaScript realm tied to a JsRuntime, that allows execution in the realm’s context.
  • A single execution context of JavaScript. Corresponds roughly to the “Web Worker” concept in the DOM. A JsRuntime is a Future that can be used with an event loop (Tokio, async_std). The JsRuntime future completes when there is an error or when all pending ops have completed.
  • This structure is used responsible for providing inspector interface to the JsRuntime.
  • A local inspector session that can be used to send and receive protocol messages directly on the same thread as an isolate.
  • EsModule source code that will be loaded into V8.
  • Placeholder structure used when creating a runtime that doesn’t support module loading.
  • Maintains the resources and ops inside a JS runtime.
  • An RcRef encapsulates a reference counted pointer, just like a regular std::rc::Rc. However, unlike a regular Rc, it can be remapped so that it dereferences to any value that’s reachable through the reference-counted pointer. This is achieved through the associated method, RcRef::map(), similar to how std::cell::Ref::map() works. Example:
  • Map-like data structure storing Deno’s resources (equivalent to file descriptors).
  • A queue that executes tasks sequentially one after the other ensuring order and that no task runs at the same time as another.
  • A permit that when dropped will allow another task to proceed.
  • Auto-generated by deno_ops, i.e: #[op]
  • Auto-generated by deno_ops, i.e: #[op]
  • Auto-generated by deno_ops, i.e: #[op]
  • Auto-generated by deno_ops, i.e: #[op]
  • Auto-generated by deno_ops, i.e: #[op]

Enums

Constants

Traits

  • The RcLike trait provides an abstraction over std::rc::Rc and RcRef, so that applicable methods can operate on either type.
  • Resources are Rust objects that are attached to a [deno_core::JsRuntime]. They are identified in JS by a numeric ID (the resource ID, or rid). Resources can be created in ops. Resources can also be retrieved in ops by their rid. Resources are not thread-safe - they can only be accessed from the thread that the JsRuntime lives on.

Functions

  • Normalize all intermediate components of the path (ie. remove “./” and “../” components). Similar to fs::canonicalize() but doesn’t resolve symlinks.
  • Converts a string representing a relative or absolute path into a ModuleSpecifier. A relative path is considered relative to the passed current_dir.
  • Converts a string representing an absolute URL into a ModuleSpecifier.
  • Takes a string representing either an absolute URL or a file path, as it may be passed to deno as a command line argument. The string is interpreted as a URL if it starts with a valid URI scheme, e.g. ‘http:’ or ‘file:’ or ‘git+ssh:’. If not, it’s interpreted as a file path; if it is a relative path it’s resolved relative to passed current_dir.
  • Strips the unc prefix (ex. \?) from Windows paths.
  • Pass the command line arguments to v8. Returns a vector of command line arguments that V8 did not understand.

Type Definitions

Attribute Macros