[{"data":1,"prerenderedAt":1082},["ShallowReactive",2],{"navigation":3,"\u002Frust\u002Fegui2":144,"\u002Frust\u002Fegui2-surround":1079},[4,36,53,86,131],{"title":5,"path":6,"stem":7,"children":8,"icon":35},"Golang","\u002Fgolang","1.golang\u002F1.index",[9,11,15,19,23,27,31],{"title":10,"path":6,"stem":7},"golang-各种golang学习以及使用过程中记录",{"title":12,"path":13,"stem":14},"gopls-官方gopls内置mcp server的基本使用","\u002Fgolang\u002Fgopls_mcp_usages","1.golang\u002F2.gopls_mcp_usages",{"title":16,"path":17,"stem":18},"实践-(一)创建简单的http服务器","\u002Fgolang\u002Fgo_http_simple_server","1.golang\u002F3.go_http_simple_server",{"title":20,"path":21,"stem":22},"wails入门系列(一)环境安装与demo","\u002Fgolang\u002Fwails_start","1.golang\u002F4.wails_start",{"title":24,"path":25,"stem":26},"wails入门系列(二)无边框应用的菜单栏以及窗口拖拽","\u002Fgolang\u002Fwails_frameless","1.golang\u002F5.wails_frameless",{"title":28,"path":29,"stem":30},"go\u002Fredis-redis中大数字自动转换成指数形式的处理","\u002Fgolang\u002Fredis_big_num","1.golang\u002F6.redis_big_num",{"title":32,"path":33,"stem":34},"go\u002F方法记录-局部坐标与世界坐标间的相互转换(位置\u002F方向)","\u002Fgolang\u002Fworld_local_transform","1.golang\u002F7.world_local_transform",false,{"title":37,"icon":35,"path":38,"stem":39,"children":40,"page":35},"瞎折腾","\u002Ftinkering","2.tinkering",[41,45,49],{"title":42,"path":43,"stem":44},"mi50显卡ubuntu运行大模型开坑(一)显卡准备以及驱动安装","\u002Ftinkering\u002Fmi50_gpu_llm_1","2.tinkering\u002F1.mi50_gpu_llm_1",{"title":46,"path":47,"stem":48},"mi50显卡ubuntu运行大模型开坑(二)使用llama.cpp部署Qwen3系列","\u002Ftinkering\u002Fmi50_gpu_llm_2","2.tinkering\u002F2.mi50_gpu_llm_2",{"title":50,"path":51,"stem":52},"mi50显卡ubuntu运行大模型开坑(三)安装风扇并且控制转速","\u002Ftinkering\u002Fmi50_gpu_llm_3","2.tinkering\u002F3.mi50_gpu_llm_3",{"title":54,"icon":35,"path":55,"stem":56,"children":57,"page":35},"LLM","\u002Fllm","3.llm",[58,62,66,70,74,78,82],{"title":59,"path":60,"stem":61},"langchain入门-安装以及初次使用(deepseek api版本)","\u002Fllm\u002Flangchain1","3.llm\u002F01.langchain1",{"title":63,"path":64,"stem":65},"langchain入门-使用langchain调用本地部署的大模型(以llama.cpp以及ollama为例)","\u002Fllm\u002Flangchain2","3.llm\u002F02.langchain2",{"title":67,"path":68,"stem":69},"langchain入门-使用langchain编写一个简单的聊天机器人(DeepSeek API&命令行版本)","\u002Fllm\u002Flangchain3","3.llm\u002F03.langchain3",{"title":71,"path":72,"stem":73},"langchain入门-使用langchain构建一个拥有RAG能力的代码问答应用(DeepSeek API&本地bge-m3&命令行版本)","\u002Fllm\u002Flangchain4","3.llm\u002F04.langchain4",{"title":75,"path":76,"stem":77},"golang\u002Feino eino框架的基础使用 Message以及ChatModel入门","\u002Fllm\u002Feino1","3.llm\u002F05.eino1",{"title":79,"path":80,"stem":81},"golang\u002Feino eino框架的基础使用 在ChatModel中使用工具","\u002Fllm\u002Feino2","3.llm\u002F06.eino2",{"title":83,"path":84,"stem":85},"llm\u002Fagent agent-zero初步搭建与使用","\u002Fllm\u002Fagent_zero_start","3.llm\u002F07.agent_zero_start",{"title":87,"icon":35,"path":88,"stem":89,"children":90,"page":35},"Verilog","\u002Fverilog","4.verilog",[91,95,99,103,107,111,115,119,123,127],{"title":92,"path":93,"stem":94},"31条指令单周期cpu设计(Verilog)-(一)相关软件","\u002Fverilog\u002Fmips1","4.verilog\u002F01.mips1",{"title":96,"path":97,"stem":98},"31条指令单周期cpu设计(Verilog)-(二)总体设计","\u002Fverilog\u002Fmips2","4.verilog\u002F02.mips2",{"title":100,"path":101,"stem":102},"31条指令单周期cpu设计(Verilog)-(三)指令分析","\u002Fverilog\u002Fmips3","4.verilog\u002F03.mips3",{"title":104,"path":105,"stem":106},"31条指令单周期cpu设计(Verilog)-(四)数据输入输出关系表","\u002Fverilog\u002Fmips4","4.verilog\u002F04.mips4",{"title":108,"path":109,"stem":110},"31条指令单周期cpu设计(Verilog)-(五)整体数据通路图设计","\u002Fverilog\u002Fmips5","4.verilog\u002F05.mips5",{"title":112,"path":113,"stem":114},"31条指令单周期cpu设计(Verilog)-(六)指令操作时间表设计","\u002Fverilog\u002Fmips6","4.verilog\u002F06.mips6",{"title":116,"path":117,"stem":118},"31条指令单周期cpu设计(Verilog)-(七)整体代码结构","\u002Fverilog\u002Fmips7","4.verilog\u002F07.mips7",{"title":120,"path":121,"stem":122},"31条指令单周期cpu设计(Verilog)-(八)上代码→指令译码以及控制器","\u002Fverilog\u002Fmips8","4.verilog\u002F08.mips8",{"title":124,"path":125,"stem":126},"31条指令单周期cpu设计(Verilog)-(九)上代码→基础模块实现","\u002Fverilog\u002Fmips9","4.verilog\u002F09.mips9",{"title":128,"path":129,"stem":130},"31条指令单周期cpu设计(Verilog)-(十)上代码→顶层模块设计&总结","\u002Fverilog\u002Fmips10","4.verilog\u002F10.mips10",{"title":132,"icon":35,"path":133,"stem":134,"children":135,"page":35},"Rust","\u002Frust","5.rust",[136,140],{"title":137,"path":138,"stem":139},"egui(一)从编译运行template开始","\u002Frust\u002Fegui1","5.rust\u002F01.egui1",{"title":141,"path":142,"stem":143},"egui(二)看看template的main函数：日志输出以及eframe run_native","\u002Frust\u002Fegui2","5.rust\u002F02.egui2",{"id":145,"title":141,"body":146,"description":1070,"extension":1071,"links":1072,"meta":1073,"navigation":132,"path":142,"seo":1075,"stem":143,"__hash__":1078},"docs\u002F5.rust\u002F02.egui2.md",{"type":147,"value":148,"toc":1062},"minimark",[149,153,185,188,334,337,665,668,979,983,1036,1039,1058],[150,151,152],"h2",{"id":152},"说在前面",[154,155,156],"blockquote",{},[157,158,159,163,166,169,172,175],"ul",{},[160,161,162],"li",{},"rust新手，egui没啥找到啥教程，这里自己记录下学习过程",[160,164,165],{},"环境：windows11 22H2",[160,167,168],{},"rust版本：rustc 1.71.1",[160,170,171],{},"egui版本：0.22.0",[160,173,174],{},"eframe版本：0.22.0",[160,176,177,178],{},"上一篇：",[179,180,184],"a",{"href":181,"rel":182},"https:\u002F\u002Fblog.csdn.net\u002Fqq_33446100\u002Farticle\u002Fdetails\u002F132250198",[183],"nofollow","这里",[150,186,187],{"id":187},"开始",[157,189,190],{},[160,191,192,193,197,198],{},"首先让我们看看",[194,195,196],"code",{},"main.rs","中有些什么\n",[199,200,205],"pre",{"className":201,"code":202,"language":203,"meta":204,"style":204},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","#![warn(clippy::all, rust_2018_idioms)]\n#![cfg_attr(not(debug_assertions), windows_subsystem = \"windows\")] \n\u002F\u002F 在release模式中隐藏控制台窗口(实际上我怎么试也没找到这个窗口) 本文放弃关注\n\n\u002F\u002F 非wasm架构\n#[cfg(not(target_arch = \"wasm32\"))]\nfn main() -> eframe::Result\u003C()> {\n    env_logger::init(); \u002F\u002F 初始化log参数，debug模式下仅会打印error日志\n\n    let native_options = eframe::NativeOptions::default(); \u002F\u002F 初始化eframe默认参数\n    eframe::run_native(\n        \"demo app\",\n        native_options,\n        Box::new(|cc| Box::new(demo_app::TemplateApp::new(cc))),\n    )\n    \u002F\u002F 启动eframe\n}\n\n\u002F\u002F When compiling to web using trunk:\n#[cfg(target_arch = \"wasm32\")]\n\u002F\u002F ... 本文暂不关注wasm相关内容\n","rust","",[194,206,207,215,221,227,234,240,246,252,258,263,269,275,281,287,293,299,305,311,316,322,328],{"__ignoreMap":204},[208,209,212],"span",{"class":210,"line":211},"line",1,[208,213,214],{},"#![warn(clippy::all, rust_2018_idioms)]\n",[208,216,218],{"class":210,"line":217},2,[208,219,220],{},"#![cfg_attr(not(debug_assertions), windows_subsystem = \"windows\")] \n",[208,222,224],{"class":210,"line":223},3,[208,225,226],{},"\u002F\u002F 在release模式中隐藏控制台窗口(实际上我怎么试也没找到这个窗口) 本文放弃关注\n",[208,228,230],{"class":210,"line":229},4,[208,231,233],{"emptyLinePlaceholder":232},true,"\n",[208,235,237],{"class":210,"line":236},5,[208,238,239],{},"\u002F\u002F 非wasm架构\n",[208,241,243],{"class":210,"line":242},6,[208,244,245],{},"#[cfg(not(target_arch = \"wasm32\"))]\n",[208,247,249],{"class":210,"line":248},7,[208,250,251],{},"fn main() -> eframe::Result\u003C()> {\n",[208,253,255],{"class":210,"line":254},8,[208,256,257],{},"    env_logger::init(); \u002F\u002F 初始化log参数，debug模式下仅会打印error日志\n",[208,259,261],{"class":210,"line":260},9,[208,262,233],{"emptyLinePlaceholder":232},[208,264,266],{"class":210,"line":265},10,[208,267,268],{},"    let native_options = eframe::NativeOptions::default(); \u002F\u002F 初始化eframe默认参数\n",[208,270,272],{"class":210,"line":271},11,[208,273,274],{},"    eframe::run_native(\n",[208,276,278],{"class":210,"line":277},12,[208,279,280],{},"        \"demo app\",\n",[208,282,284],{"class":210,"line":283},13,[208,285,286],{},"        native_options,\n",[208,288,290],{"class":210,"line":289},14,[208,291,292],{},"        Box::new(|cc| Box::new(demo_app::TemplateApp::new(cc))),\n",[208,294,296],{"class":210,"line":295},15,[208,297,298],{},"    )\n",[208,300,302],{"class":210,"line":301},16,[208,303,304],{},"    \u002F\u002F 启动eframe\n",[208,306,308],{"class":210,"line":307},17,[208,309,310],{},"}\n",[208,312,314],{"class":210,"line":313},18,[208,315,233],{"emptyLinePlaceholder":232},[208,317,319],{"class":210,"line":318},19,[208,320,321],{},"\u002F\u002F When compiling to web using trunk:\n",[208,323,325],{"class":210,"line":324},20,[208,326,327],{},"#[cfg(target_arch = \"wasm32\")]\n",[208,329,331],{"class":210,"line":330},21,[208,332,333],{},"\u002F\u002F ... 本文暂不关注wasm相关内容\n",[150,335,336],{"id":336},"日志输出",[157,338,339,401,465,503,605],{},[160,340,341,342,345,346,353,354,361,362],{},"在",[194,343,344],{},"eframe","中使用的日志库为",[179,347,350],{"href":348,"rel":349},"https:\u002F\u002Fdocs.rs\u002Flog\u002Flatest\u002Flog\u002F",[183],[194,351,352],{},"log","以及",[179,355,358],{"href":356,"rel":357},"https:\u002F\u002Fdocs.rs\u002Fenv_logger\u002Flatest\u002Fenv_logger\u002F",[183],[194,359,360],{},"env_logger","，其日志等级有5个：\n",[199,363,365],{"className":201,"code":364,"language":203,"meta":204,"style":204},"pub enum Level {\n    Error,\n    Warn,\n    Info,\n    Debug,\n    Trace,\n}\n",[194,366,367,372,377,382,387,392,397],{"__ignoreMap":204},[208,368,369],{"class":210,"line":211},[208,370,371],{},"pub enum Level {\n",[208,373,374],{"class":210,"line":217},[208,375,376],{},"    Error,\n",[208,378,379],{"class":210,"line":223},[208,380,381],{},"    Warn,\n",[208,383,384],{"class":210,"line":229},[208,385,386],{},"    Info,\n",[208,388,389],{"class":210,"line":236},[208,390,391],{},"    Debug,\n",[208,393,394],{"class":210,"line":242},[208,395,396],{},"    Trace,\n",[208,398,399],{"class":210,"line":248},[208,400,310],{},[160,402,403,404],{},"我们可以在main函数中添加测试一下：\n",[199,405,407],{"className":201,"code":406,"language":203,"meta":204,"style":204},"fn main() -> eframe::Result\u003C()> {\n    env_logger::init(); \n    \u002F\u002F Log to stderr (if you run with `RUST_LOG=debug`).\n\n    log::info!(\"1\");\n    log::warn!(\"2\");\n    log::error!(\"3\");\n    log::trace!(\"4\");\n    log::debug!(\"5\");\n\n    \u002F\u002F ...\n}\n",[194,408,409,413,418,423,427,432,437,442,447,452,456,461],{"__ignoreMap":204},[208,410,411],{"class":210,"line":211},[208,412,251],{},[208,414,415],{"class":210,"line":217},[208,416,417],{},"    env_logger::init(); \n",[208,419,420],{"class":210,"line":223},[208,421,422],{},"    \u002F\u002F Log to stderr (if you run with `RUST_LOG=debug`).\n",[208,424,425],{"class":210,"line":229},[208,426,233],{"emptyLinePlaceholder":232},[208,428,429],{"class":210,"line":236},[208,430,431],{},"    log::info!(\"1\");\n",[208,433,434],{"class":210,"line":242},[208,435,436],{},"    log::warn!(\"2\");\n",[208,438,439],{"class":210,"line":248},[208,440,441],{},"    log::error!(\"3\");\n",[208,443,444],{"class":210,"line":254},[208,445,446],{},"    log::trace!(\"4\");\n",[208,448,449],{"class":210,"line":260},[208,450,451],{},"    log::debug!(\"5\");\n",[208,453,454],{"class":210,"line":265},[208,455,233],{"emptyLinePlaceholder":232},[208,457,458],{"class":210,"line":271},[208,459,460],{},"    \u002F\u002F ...\n",[208,462,463],{"class":210,"line":277},[208,464,310],{},[160,466,467,468,471,472,475,476,479,480],{},"执行",[194,469,470],{},"cargo run","，只能看到",[194,473,474],{},"error","输出；使用",[194,477,478],{},"cargo run --release","的话什么日志都没有了\n",[199,481,485],{"className":482,"code":483,"language":484,"meta":204,"style":204},"language-shell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[2023-08-13T09:20:59Z ERROR demo_app] 3\n","shell",[194,486,487],{"__ignoreMap":204},[208,488,489,493,497,500],{"class":210,"line":211},[208,490,492],{"class":491},"sMK4o","[",[208,494,496],{"class":495},"sTEyZ","2023-08-13T09:20:59Z ERROR demo_app",[208,498,499],{"class":491},"]",[208,501,502],{"class":495}," 3\n",[160,504,505,507,508,511,512,515,516,540,541],{},[194,506,360],{},"可以指定日志输出的级别以及目标，当我们在",[194,509,510],{},"cmd","下执行（注意",[194,513,514],{},"powershell","的设置环境变量的语法不一样）：\n",[199,517,519],{"className":482,"code":518,"language":484,"meta":204,"style":204},"set RUST_LOG=demo_app\ncargo run\n",[194,520,521,531],{"__ignoreMap":204},[208,522,523,527],{"class":210,"line":211},[208,524,526],{"class":525},"s2Zo4","set",[208,528,530],{"class":529},"sfazB"," RUST_LOG=demo_app\n",[208,532,533,537],{"class":210,"line":217},[208,534,536],{"class":535},"sBMFI","cargo",[208,538,539],{"class":529}," run\n","\n这会将我们的项目(demo_app)下所有的级别的log进行输出，现在我们能看到所有级别的日志了\n",[199,542,544],{"className":482,"code":543,"language":484,"meta":204,"style":204},"[2023-08-13T09:27:18Z INFO  demo_app] 1\n[2023-08-13T09:27:18Z WARN  demo_app] 2\n[2023-08-13T09:27:18Z ERROR demo_app] 3\n[2023-08-13T09:27:18Z TRACE demo_app] 4\n[2023-08-13T09:27:18Z DEBUG demo_app] 5\n",[194,545,546,558,570,581,593],{"__ignoreMap":204},[208,547,548,550,553,555],{"class":210,"line":211},[208,549,492],{"class":491},[208,551,552],{"class":495},"2023-08-13T09:27:18Z INFO  demo_app",[208,554,499],{"class":491},[208,556,557],{"class":495}," 1\n",[208,559,560,562,565,567],{"class":210,"line":217},[208,561,492],{"class":491},[208,563,564],{"class":495},"2023-08-13T09:27:18Z WARN  demo_app",[208,566,499],{"class":491},[208,568,569],{"class":495}," 2\n",[208,571,572,574,577,579],{"class":210,"line":223},[208,573,492],{"class":491},[208,575,576],{"class":495},"2023-08-13T09:27:18Z ERROR demo_app",[208,578,499],{"class":491},[208,580,502],{"class":495},[208,582,583,585,588,590],{"class":210,"line":229},[208,584,492],{"class":491},[208,586,587],{"class":495},"2023-08-13T09:27:18Z TRACE demo_app",[208,589,499],{"class":491},[208,591,592],{"class":495}," 4\n",[208,594,595,597,600,602],{"class":210,"line":236},[208,596,492],{"class":491},[208,598,599],{"class":495},"2023-08-13T09:27:18Z DEBUG demo_app",[208,601,499],{"class":491},[208,603,604],{"class":495}," 5\n",[160,606,607,608,610,611,629,630],{},"现在我们尝试下将",[194,609,344],{},"的日志都输出：\n",[199,612,614],{"className":482,"code":613,"language":484,"meta":204,"style":204},"set RUST_LOG=eframe\ncargo run\n",[194,615,616,623],{"__ignoreMap":204},[208,617,618,620],{"class":210,"line":211},[208,619,526],{"class":525},[208,621,622],{"class":529}," RUST_LOG=eframe\n",[208,624,625,627],{"class":210,"line":217},[208,626,536],{"class":535},[208,628,539],{"class":529},"\n可以看到大量的日志输出：\n",[199,631,633],{"className":482,"code":632,"language":484,"meta":204,"style":204},"[2023-08-13T09:31:29Z DEBUG eframe] Using the glow renderer\n[2023-08-13T09:31:29Z DEBUG eframe::native::run] Entering the winit event loop (run_return)…\n",[194,634,635,647],{"__ignoreMap":204},[208,636,637,639,642,644],{"class":210,"line":211},[208,638,492],{"class":491},[208,640,641],{"class":495},"2023-08-13T09:31:29Z DEBUG eframe",[208,643,499],{"class":491},[208,645,646],{"class":495}," Using the glow renderer\n",[208,648,649,651,654,656,659,662],{"class":210,"line":217},[208,650,492],{"class":491},[208,652,653],{"class":495},"2023-08-13T09:31:29Z DEBUG eframe::native::run",[208,655,499],{"class":491},[208,657,658],{"class":495}," Entering the winit event loop (",[208,660,661],{"class":535},"run_return",[208,663,664],{"class":495},")…\n",[150,666,667],{"id":667},"eframe初始化参数",[157,669,670,892,971],{},[160,671,672,673,676,677,680,681],{},"在main函数中调用",[194,674,675],{},"eframe::run_native()","时使用到了一个",[194,678,679],{},"native_options","，让我们看看这里面有些什么：",[199,682,684],{"className":482,"code":683,"language":484,"meta":204,"style":204},"always_on_top: bool\nSets whether or not the window will always be on top of other windows at initialization.\n\nmaximized: bool\nShow window in maximized mode\n\ndecorated: bool\nOn desktop: add window decorations (i.e. a frame around your app)? \nIf false it will be difficult to move and resize the app.\n\nfullscreen: bool\nStart in (borderless) fullscreen?\n\n...\n",[194,685,686,694,744,748,755,771,775,782,824,859,863,870,883,887],{"__ignoreMap":204},[208,687,688,691],{"class":210,"line":211},[208,689,690],{"class":535},"always_on_top:",[208,692,693],{"class":529}," bool\n",[208,695,696,699,702,705,708,711,714,717,720,723,726,729,732,735,738,741],{"class":210,"line":217},[208,697,698],{"class":535},"Sets",[208,700,701],{"class":529}," whether",[208,703,704],{"class":529}," or",[208,706,707],{"class":529}," not",[208,709,710],{"class":529}," the",[208,712,713],{"class":529}," window",[208,715,716],{"class":529}," will",[208,718,719],{"class":529}," always",[208,721,722],{"class":529}," be",[208,724,725],{"class":529}," on",[208,727,728],{"class":529}," top",[208,730,731],{"class":529}," of",[208,733,734],{"class":529}," other",[208,736,737],{"class":529}," windows",[208,739,740],{"class":529}," at",[208,742,743],{"class":529}," initialization.\n",[208,745,746],{"class":210,"line":223},[208,747,233],{"emptyLinePlaceholder":232},[208,749,750,753],{"class":210,"line":229},[208,751,752],{"class":535},"maximized:",[208,754,693],{"class":529},[208,756,757,760,762,765,768],{"class":210,"line":236},[208,758,759],{"class":535},"Show",[208,761,713],{"class":529},[208,763,764],{"class":529}," in",[208,766,767],{"class":529}," maximized",[208,769,770],{"class":529}," mode\n",[208,772,773],{"class":210,"line":242},[208,774,233],{"emptyLinePlaceholder":232},[208,776,777,780],{"class":210,"line":248},[208,778,779],{"class":535},"decorated:",[208,781,693],{"class":529},[208,783,784,787,790,793,795,798,801,803,806,809,812,815,818,821],{"class":210,"line":254},[208,785,786],{"class":535},"On",[208,788,789],{"class":529}," desktop:",[208,791,792],{"class":529}," add",[208,794,713],{"class":529},[208,796,797],{"class":529}," decorations",[208,799,800],{"class":495}," (i.e. ",[208,802,179],{"class":529},[208,804,805],{"class":529}," frame",[208,807,808],{"class":529}," around",[208,810,811],{"class":529}," your",[208,813,814],{"class":529}," app",[208,816,817],{"class":495},")",[208,819,820],{"class":491},"?",[208,822,823],{"class":495}," \n",[208,825,826,829,832,835,837,839,842,845,848,851,854,856],{"class":210,"line":260},[208,827,828],{"class":535},"If",[208,830,831],{"class":491}," false",[208,833,834],{"class":529}," it",[208,836,716],{"class":529},[208,838,722],{"class":529},[208,840,841],{"class":529}," difficult",[208,843,844],{"class":529}," to",[208,846,847],{"class":529}," move",[208,849,850],{"class":529}," and",[208,852,853],{"class":529}," resize",[208,855,710],{"class":529},[208,857,858],{"class":529}," app.\n",[208,860,861],{"class":210,"line":265},[208,862,233],{"emptyLinePlaceholder":232},[208,864,865,868],{"class":210,"line":271},[208,866,867],{"class":535},"fullscreen:",[208,869,693],{"class":529},[208,871,872,875,877,880],{"class":210,"line":277},[208,873,874],{"class":535},"Start",[208,876,764],{"class":529},[208,878,879],{"class":495}," (borderless) fullscreen",[208,881,882],{"class":491},"?\n",[208,884,885],{"class":210,"line":283},[208,886,233],{"emptyLinePlaceholder":232},[208,888,889],{"class":210,"line":289},[208,890,891],{"class":525},"...\n",[160,893,894,895],{},"我们可以试着改几个看看效果",[157,896,897,920,946],{},[160,898,899,900,915],{},"always_on_top\n",[199,901,903],{"className":201,"code":902,"language":203,"meta":204,"style":204},"let mut native_options = eframe::NativeOptions::default();\nnative_options.always_on_top = true;\n",[194,904,905,910],{"__ignoreMap":204},[208,906,907],{"class":210,"line":211},[208,908,909],{},"let mut native_options = eframe::NativeOptions::default();\n",[208,911,912],{"class":210,"line":217},[208,913,914],{},"native_options.always_on_top = true;\n",[916,917],"img",{"alt":918,"src":919},"在这里插入图片描述",".\u002Frust\u002F10.webp",[160,921,922,923,942,945],{},"decorated\n",[199,924,926],{"className":201,"code":925,"language":203,"meta":204,"style":204},"let mut native_options = eframe::NativeOptions::default();\n    native_options.always_on_top = true;\n    native_options.decorated = false;\n",[194,927,928,932,937],{"__ignoreMap":204},[208,929,930],{"class":210,"line":211},[208,931,909],{},[208,933,934],{"class":210,"line":217},[208,935,936],{},"    native_options.always_on_top = true;\n",[208,938,939],{"class":210,"line":223},[208,940,941],{},"    native_options.decorated = false;\n",[916,943],{"alt":918,"src":944},".\u002Frust\u002F11.webp","\n毫无灵魂了，甚至和背景融为一体了",[160,947,948,949,968],{},"transparent\n",[199,950,952],{"className":201,"code":951,"language":203,"meta":204,"style":204},"let mut native_options = eframe::NativeOptions::default();\n    native_options.transparent = true;\n\u002F\u002F 同时注释掉app.rs中 egui::CentralPanel::default() 代码\n",[194,953,954,958,963],{"__ignoreMap":204},[208,955,956],{"class":210,"line":211},[208,957,909],{},[208,959,960],{"class":210,"line":217},[208,961,962],{},"    native_options.transparent = true;\n",[208,964,965],{"class":210,"line":223},[208,966,967],{},"\u002F\u002F 同时注释掉app.rs中 egui::CentralPanel::default() 代码\n",[916,969],{"alt":918,"src":970},".\u002Frust\u002F12.webp",[160,972,973,974,978],{},"其他详细参数见",[179,975,184],{"href":976,"rel":977},"https:\u002F\u002Fdocs.rs\u002Feframe\u002Flatest\u002Feframe\u002Fstruct.NativeOptions.html#fields",[183],"，大家可以自己试试",[150,980,982],{"id":981},"eframerun_native","eframe::run_native",[157,984,985,1018],{},[160,986,987,988],{},"调用该函数创建我们的应用窗口，其定义为：\n",[199,989,991],{"className":201,"code":990,"language":203,"meta":204,"style":204},"pub fn run_native(\n    app_name: &str, \u002F\u002F 应用名\n    native_options: NativeOptions, \u002F\u002F 初始化选项\n    app_creator: AppCreator \u002F\u002F 应用主逻辑\n) -> Result\u003C()>\n",[194,992,993,998,1003,1008,1013],{"__ignoreMap":204},[208,994,995],{"class":210,"line":211},[208,996,997],{},"pub fn run_native(\n",[208,999,1000],{"class":210,"line":217},[208,1001,1002],{},"    app_name: &str, \u002F\u002F 应用名\n",[208,1004,1005],{"class":210,"line":223},[208,1006,1007],{},"    native_options: NativeOptions, \u002F\u002F 初始化选项\n",[208,1009,1010],{"class":210,"line":229},[208,1011,1012],{},"    app_creator: AppCreator \u002F\u002F 应用主逻辑\n",[208,1014,1015],{"class":210,"line":236},[208,1016,1017],{},") -> Result\u003C()>\n",[160,1019,1020,1021,1024,1025,1029,1030,1033],{},"app_name\n应用名称，在我们的例子中为",[194,1022,1023],{},"demo app","；同时该值也是我们的窗口显示的名称，同时也是持久化存储(",[1026,1027,1028],"del",{},"下一节看看"," )目录的名称；\n",[916,1031],{"alt":918,"src":1032},".\u002Frust\u002F13.webp",[916,1034],{"alt":918,"src":1035},".\u002Frust\u002F14.webp",[150,1037,1038],{"id":1038},"相关参考",[157,1040,1041,1046,1051],{},[160,1042,1043],{},[179,1044,352],{"href":348,"rel":1045},[183],[160,1047,1048],{},[179,1049,360],{"href":356,"rel":1050},[183],[160,1052,1053],{},[179,1054,1057],{"href":1055,"rel":1056},"https:\u002F\u002Fusers.rust-lang.org\u002Ft\u002Fhow-to-use-log-crate\u002F6220",[183],"log无法单独使用",[1059,1060,1061],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":204,"searchDepth":211,"depth":217,"links":1063},[1064,1065,1066,1067,1068,1069],{"id":152,"depth":217,"text":152},{"id":187,"depth":217,"text":187},{"id":336,"depth":217,"text":336},{"id":667,"depth":217,"text":667},{"id":981,"depth":217,"text":982},{"id":1038,"depth":217,"text":1038},"深入解析 egui eframe 模板 main 函数，介绍 env_logger 日志配置、RUST_LOG 环境变量使用以及 NativeOptions 窗口参数配置方法。","md",null,{"date":1074},"2023-08-13 18:16:42",{"title":1076,"description":1077},"【rust\u002Fegui】egui(二)看看template的main函数：日志输出以及eframe run_native","深入解析 egui eframe 模板 main 函数，介绍 env_logger 日志配置、RUST_LOG 环境变量使用以及 NativeOptions 窗口参数（always_on_top、decorated、transparent）配置方法。","aO6F6OGsZkdYz8S5lrwaoGO0IDqkMdwVqKxXP6gkw2E",[1080,1072],{"title":137,"path":138,"stem":139,"description":1081,"children":-1},"Rust egui GUI 框架入门教程，介绍 eframe_template 项目克隆、编译运行、项目名称修改以及 WebAssembly 构建与 trunk 部署流程。",1776616492753]