Skip to main content

Manifest

Struct Manifest 

Source
pub struct Manifest {
Show 14 fields pub schema: String, pub root: PathBuf, pub root_written: Option<PathBuf>, pub unit: String, pub language: Lang, pub kind: Kind, pub crate_name: String, pub exports: Vec<ExportedFn>, pub classes: Vec<ExportedClass>, pub js_only: Vec<JsOnly>, pub batches: Vec<Batch>, pub allocator: Allocator, pub float_tolerance: Option<f64>, pub ignore_key_order: bool,
}
Expand description

What bridge generated; every later step starts from it.

Fields§

§schema: String§root: PathBuf

The repository root: absolute, or relative to the crate folder (so a crate kept inside the repository it ports works in any clone). Resolved when the manifest is loaded.

§root_written: Option<PathBuf>

root as written in the file, when it was relative; written back instead of the resolved path.

§unit: String§language: Lang§kind: Kind§crate_name: String§exports: Vec<ExportedFn>

Exports ported to Rust.

§classes: Vec<ExportedClass>

Exported classes ported to Rust: a struct with new and methods.

§js_only: Vec<JsOnly>

Exports that cannot cross the bridge as they are; they stay in TS and the shadow module re-exports them from the original.

§batches: Vec<Batch>

Functions run over many items kept in Rust (--batch function:param).

§allocator: Allocator

The global allocator when the crate has batches (bridge --allocator).

§float_tolerance: Option<f64>

Floats match within this relative tolerance (record --float-tolerance).

§ignore_key_order: bool

Objects match regardless of key order (record --ignore-key-order).

Implementations§

Source§

impl Manifest

Source

pub fn load(crate_dir: &Path) -> Result<Self>

Source

pub fn save(&self, crate_dir: &Path) -> Result<()>

Writes the manifest back, keeping a relative root relative.

Source

pub fn lib_name(&self) -> String

Rust library name: the crate name with - replaced.

Trait Implementations§

Source§

impl Clone for Manifest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Manifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Manifest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Manifest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.