Spike, not the final UI: it answers whether flare-ui can drive Alkane OS's on-box pages, and what it costs. What works: - schema/alkane-bb.json authors the sidebar as data (3 sections, 14 tabs); - src/bin/ui-spike.rs renders it through flare_ui::nav + flare_ui::shell, so the unified sidebar, ordering and surface filtering come from the schema rather than from hand-written HTML; - the render uses the shared bf- design tokens, the same ones the rest of the suite uses. Size, measured rather than assumed (armv7, release, stripped): ui-baseline 323 KiB (maud + serde_json, no flare-ui) ui-spike 771 KiB (flare-ui + wschema + sha2) marginal 448 KiB Vendoring: third-party/flare-ui is the full v0.2.9 tree pinned in flare-ui/flare-ui.lock (a partial archive does not compile, since the crate include_str!s assets from dash-editor/). vendor/ is re-generated as a cargo directory source with the new registry dependencies (maud, sha2, typenum, digest, generic-array, block-buffer, crypto-common, cfg-if, etc.) so the build still works offline. third-party/README.md records how to re-pin.
68 lines
2.1 KiB
Rust
68 lines
2.1 KiB
Rust
// Copyright 2026 The Fuchsia Authors
|
|
//
|
|
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
|
|
// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
|
|
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
|
|
// This file may not be copied, modified, or distributed except according to
|
|
// those terms.
|
|
|
|
extern crate zerocopy;
|
|
|
|
#[allow(unused)]
|
|
#[cfg(feature = "derive")]
|
|
mod util {
|
|
/// A type that doesn't implement any zerocopy traits.
|
|
pub struct NotZerocopy<T = ()>(pub T);
|
|
|
|
/// A `u16` with alignment 2.
|
|
///
|
|
/// Though `u16` has alignment 2 on some platforms, it's not guaranteed. By
|
|
/// contrast, `util::AU16` is guaranteed to have alignment 2.
|
|
#[derive(
|
|
zerocopy::KnownLayout,
|
|
zerocopy::Immutable,
|
|
zerocopy::FromBytes,
|
|
zerocopy::IntoBytes,
|
|
Copy,
|
|
Clone,
|
|
)]
|
|
#[repr(C, align(2))]
|
|
pub struct AU16(pub u16);
|
|
|
|
// Since we can't import these by path (ie, `util::assert_impl_all!`), use a
|
|
// name prefix to ensure our derive-emitted code isn't accidentally relying
|
|
// on `assert_impl_all!` being in scope.
|
|
#[macro_export]
|
|
macro_rules! util_assert_impl_all {
|
|
($type:ty: $($trait:path),+ $(,)?) => {
|
|
const _: fn() = || {
|
|
use ::core::prelude::v1::*;
|
|
::static_assertions::assert_impl_all!($type: $($trait),+);
|
|
};
|
|
};
|
|
}
|
|
|
|
// Since we can't import these by path (ie, `util::assert_not_impl_any!`),
|
|
// use a name prefix to ensure our derive-emitted code isn't accidentally
|
|
// relying on `assert_not_impl_any!` being in scope.
|
|
#[macro_export]
|
|
macro_rules! util_assert_not_impl_any {
|
|
($x:ty: $($t:path),+ $(,)?) => {
|
|
const _: fn() = || {
|
|
use ::core::prelude::v1::*;
|
|
::static_assertions::assert_not_impl_any!($x: $($t),+);
|
|
};
|
|
};
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! test_trivial_is_safe {
|
|
($x:ty => $name:ident) => {
|
|
#[test]
|
|
fn $name() {
|
|
util::test_trivial_is_safe::<$x>();
|
|
}
|
|
};
|
|
}
|
|
}
|