Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T05:05:11.655Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

derive_into_element.rs

25 lines · 693 B · rust
1use proc_macro::TokenStream;
2use quote::quote;
3use syn::{DeriveInput, parse_macro_input};
4
5pub fn derive_into_element(input: TokenStream) -> TokenStream {
6    let ast = parse_macro_input!(input as DeriveInput);
7    let type_name = &ast.ident;
8    let (impl_generics, type_generics, where_clause) = ast.generics.split_for_impl();
9
10    let r#gen = quote! {
11        impl #impl_generics gpui::IntoElement for #type_name #type_generics
12        #where_clause
13        {
14            type Element = gpui::ViewElement<Self>;
15
16            #[track_caller]
17            fn into_element(self) -> Self::Element {
18                gpui::ViewElement::new(self)
19            }
20        }
21    };
22
23    r#gen.into()
24}
25
Served at tenant.openagents/omega Member data and write actions are omitted.