{"id":9573,"date":"2022-11-18T19:00:00","date_gmt":"2022-11-18T10:00:00","guid":{"rendered":"https:\/\/taki-lab.site\/bocci\/?p=9573"},"modified":"2022-11-17T10:19:17","modified_gmt":"2022-11-17T01:19:17","slug":"rust%e5%8b%89%e5%bc%b7%e4%b8%ad%e3%80%8111-17%e3%81%ae%e7%a9%8d%e3%81%bf%e4%b8%8a%e3%81%92","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=9573","title":{"rendered":"RUST\u52c9\u5f37\u4e2d\u300111\/17\u306e\u7a4d\u307f\u4e0a\u3052"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-\u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f wp-block-embed-\u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"PBI2NmJ0Gi\"><a href=\"https:\/\/taki-lab.site\/bocci\/?p=9480\">RUST\u52c9\u5f37\u4e2d\u300111\/3\u306e\u7a4d\u307f\u4e0a\u3052<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;RUST\u52c9\u5f37\u4e2d\u300111\/3\u306e\u7a4d\u307f\u4e0a\u3052&#8221; &#8212; \u81ea\u5206\u3001\u307c\u3063\u3061\u3067\u3059\u304c\u4f55\u304b\uff1f\" src=\"https:\/\/taki-lab.site\/bocci\/?p=9480&#038;embed=true#?secret=l0zHSPy2U5#?secret=PBI2NmJ0Gi\" data-secret=\"PBI2NmJ0Gi\" width=\"474\" height=\"267\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u30dc\u30bf\u30f3\u51e6\u7406\u306e\u5b9f\u88c5\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u306ficed\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use iced::{\n    button, executor, Align, Application, Button, Column, Command, Element, Font,\n    HorizontalAlignment, Length, Row, Settings, Subscription, Text,\n};\n\nconst FONT: Font = Font::External {\n    name: \"PixelMplus12-Regular\",\n    bytes: include_bytes!(\"..\/rsc\/PixelMplus12-Regular.ttf\"),\n};\n\n#&#91;derive(Debug, Clone)]\npub enum Message {\n    Start,\n    Stop,\n    Reset,\n}\n\npub enum TickState {\n    Stopped,\n    Ticking,\n}\n\nstruct GUI {\n    tick_state: TickState,\n    start_stop_button_state: button::State,\n    reset_button_state: button::State,\n}\n\nimpl Application for GUI {\n    type Executor = executor::Null;\n    type Message = Message;\n    type Flags = ();\n\n    fn new(_flags: ()) -&gt; (GUI, Command&lt;Self::Message&gt;) {\n        (\n            GUI {\n                tick_state: TickState::Stopped,\n                start_stop_button_state: button::State::new(),\n                reset_button_state: button::State::new(),\n            },\n            Command::none(),\n        )\n    }\n\n    fn title(&amp;self) -&gt; String {\n        String::from(\"DEMO\")\n    }\n\n    fn update(&amp;mut self, message: Self::Message) -&gt; Command&lt;Self::Message&gt; {\n        match message {\n            Message::Start =&gt; {\n                self.tick_state = TickState::Ticking;\n            }\n            Message::Stop =&gt; {\n                self.tick_state = TickState::Stopped;\n            }\n            Message::Reset =&gt; {}\n        }\n        Command::none()\n    }\n\n    fn view(&amp;mut self) -&gt; Element&lt;Self::Message&gt; {\n        let duration_text = \"00:00:00.00\";\n\n        let start_stop_text = match self.tick_state {\n            TickState::Stopped =&gt; Text::new(\"Start\")\n                .horizontal_alignment(HorizontalAlignment::Center)\n                .font(FONT),\n            TickState::Ticking =&gt; Text::new(\"Stop\")\n                .horizontal_alignment(HorizontalAlignment::Center)\n                .font(FONT),\n        };\n\n        let start_stop_message = match self.tick_state {\n            TickState::Stopped =&gt; Message::Start,\n            TickState::Ticking =&gt; Message::Stop,\n        };\n        \n        let tick_text = Text::new(\"00:00:00.00\").font(FONT).size(60);\n        let start_stop_button = Button::new(&amp;mut self.start_stop_button_state, start_stop_text)\n            .min_width(80)\n            .on_press(start_stop_message);\n        let reset_button = Button::new(\n            &amp;mut self.reset_button_state,\n            Text::new(\"Reset\")\n                .horizontal_alignment(HorizontalAlignment::Center)\n                .font(FONT),\n        )\n            .min_width(80)\n            .on_press(Message::Reset);\n\n        Column::new()\n            .push(tick_text)\n            .push(\n                Row::new()\n                    .push(start_stop_button)\n                    .push(reset_button)\n                    .spacing(10),\n            )\n            .spacing(10)\n            .padding(10)\n            .width(Length::Fill)\n            .height(Length::Fill)\n            .align_items(Align::Center)\n            .into()\n    }\n}\n\nfn main() {\n    let mut settings = Settings::default();\n    settings.window.size = (400u32, 120u32);\n    GUI::run(settings);\n}\n<\/code><\/pre>\n\n\n\n<p>Message\u306e\u5b9a\u7fa9\u3068TickState\u306e\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3068\u3057\u3066\u3001tick_state\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u578b\u306fTickState\u3067\u3059\u3002<\/p>\n\n\n\n<p>view\u306e\u51e6\u7406\u306b\u8ffd\u52a0\u3057\u3001tick_state\u306e\u72b6\u614b\u3067\u30dc\u30bf\u30f3\u306b\u8868\u793a\u3059\u308b\u30c6\u30ad\u30b9\u30c8start_stop_text\u3092\u6c7a\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u30dc\u30bf\u30f3\u51e6\u7406\u306b\u98db\u3070\u3059\u30e1\u30c3\u30bb\u30fc\u30b8start_stop_message\u306e\u5024\u3082\u6c7a\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u30dc\u30bf\u30f3\u62bc\u4e0b\u6642\u306bstart_stop_message\u3092\u98db\u3070\u3057\u3001<\/p>\n\n\n\n<p>\u305d\u308c\u3092update()\u3067\u53d7\u3051\u53d6\u3063\u3066\u3001tick_state\u306e\u5024\u3092\u5909\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"301\" data-attachment-id=\"9575\" data-permalink=\"https:\/\/taki-lab.site\/bocci\/?attachment_id=9575\" data-orig-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/11\/ice_video_20221117-091004_edit_0.gif?fit=658%2C418&amp;ssl=1\" data-orig-size=\"658,418\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ice_video_20221117-091004_edit_0\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/11\/ice_video_20221117-091004_edit_0.gif?fit=474%2C301&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/11\/ice_video_20221117-091004_edit_0.gif?resize=474%2C301&#038;ssl=1\" alt=\"\" class=\"wp-image-9575\"\/><\/figure>\n\n\n\n<a href=\"\/\/blog.with2.net\/link\/?2023426:9200\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2019\/12\/a72f208ffbb7386a5edac6282ebb8d1b.png?w=474\" title=\"\u65e5\u3005\u306e\u51fa\u6765\u4e8b\u30e9\u30f3\u30ad\u30f3\u30b0\"><\/a>\n","protected":false},"excerpt":{"rendered":"<p>\u30dc\u30bf\u30f3\u51e6\u7406\u306e\u5b9f\u88c5\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002 \u30e9\u30a4\u30d6\u30e9\u30ea\u306ficed\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002 Message\u306e\u5b9a\u7fa9\u3068TickState\u306e\u5b9a\u7fa9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3068\u3057\u3066\u3001tick_state\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002 \u578b\u306f &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=9573\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">RUST\u52c9\u5f37\u4e2d\u300111\/17\u306e\u7a4d\u307f\u4e0a\u3052<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2542,3],"tags":[],"class_list":["post-9573","post","type-post","status-publish","format-standard","hentry","category-rust","category-3"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8SDbY-2up","jetpack-related-posts":[{"id":9984,"url":"https:\/\/taki-lab.site\/bocci\/?p=9984","url_meta":{"origin":9573,"position":0},"title":"RUST\u52c9\u5f37\u4e2d\u30011\/17\u306e\u7a4d\u307f\u4e0a\u3052","author":"taki","date":"2023\u5e741\u670817\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9573 \u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u51e6\u7406\u3092\u5b9f\u88c5\u2026","rel":"","context":"Rust","block_context":{"text":"Rust","link":"https:\/\/taki-lab.site\/bocci\/?cat=2542"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/01\/ice_video_20230117-110203.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/01\/ice_video_20230117-110203.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2023\/01\/ice_video_20230117-110203.gif?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":9480,"url":"https:\/\/taki-lab.site\/bocci\/?p=9480","url_meta":{"origin":9573,"position":1},"title":"RUST\u52c9\u5f37\u4e2d\u300111\/3\u306e\u7a4d\u307f\u4e0a\u3052","author":"taki","date":"2022\u5e7411\u67083\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=9411 \u4eca\u56de\u306fGUI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u2026","rel":"","context":"Rust","block_context":{"text":"Rust","link":"https:\/\/taki-lab.site\/bocci\/?cat=2542"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/11\/f1db73e69b455977b100f57fb9a1e2b0.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8891,"url":"https:\/\/taki-lab.site\/bocci\/?p=8891","url_meta":{"origin":9573,"position":2},"title":"RUST\u52c9\u5f37\u4e2d\u30017\/31\u306e\u7a4d\u307f\u4e0a\u3052","author":"taki","date":"2022\u5e748\u67082\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=8831 askama\u30af\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3059\u2026","rel":"","context":"Rust","block_context":{"text":"Rust","link":"https:\/\/taki-lab.site\/bocci\/?cat=2542"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-31-100956.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8831,"url":"https:\/\/taki-lab.site\/bocci\/?p=8831","url_meta":{"origin":9573,"position":3},"title":"RUST\u52c9\u5f37\u4e2d\u30017\/24\u306e\u7a4d\u307f\u4e0a\u3052","author":"taki","date":"2022\u5e747\u670826\u65e5","format":false,"excerpt":"https:\/\/taki-lab.site\/bocci\/?p=8785 \u30a8\u30e9\u30fc\u306e\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u5b9a\u7fa9\u3092\u8ffd\u2026","rel":"","context":"Rust","block_context":{"text":"Rust","link":"https:\/\/taki-lab.site\/bocci\/?cat=2542"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9411,"url":"https:\/\/taki-lab.site\/bocci\/?p=9411","url_meta":{"origin":9573,"position":4},"title":"RUST\u52c9\u5f37\u4e2d\u300110\/23\u306e\u7a4d\u307f\u4e0a\u3052","author":"taki","date":"2022\u5e7410\u670825\u65e5","format":false,"excerpt":"\u4eca\u56de\u304b\u3089GUI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3059\u3002 Iced\u3068\u3044\u3046\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3044\u304d\u307e\u3059\u3002 \u2026","rel":"","context":"\u51fa\u6765\u4e8b","block_context":{"text":"\u51fa\u6765\u4e8b","link":"https:\/\/taki-lab.site\/bocci\/?cat=9"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/d5588bc0167190caa161739cc622df88.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/d5588bc0167190caa161739cc622df88.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/d5588bc0167190caa161739cc622df88.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/d5588bc0167190caa161739cc622df88.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/d5588bc0167190caa161739cc622df88.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2022\/10\/d5588bc0167190caa161739cc622df88.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":8638,"url":"https:\/\/taki-lab.site\/bocci\/?p=8638","url_meta":{"origin":9573,"position":5},"title":"RUST\u52c9\u5f37\u4e2d\u30016\/26\u306e\u7a4d\u307f\u4e0a\u3052","author":"taki","date":"2022\u5e746\u670828\u65e5","format":false,"excerpt":"\u524d\u56de\u306e\u7d9a\u304d https:\/\/taki-lab.site\/bocci\/?p=8476 \u4eca\u56de\u306fthise\u2026","rel":"","context":"Rust","block_context":{"text":"Rust","link":"https:\/\/taki-lab.site\/bocci\/?cat=2542"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/9573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9573"}],"version-history":[{"count":2,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/9573\/revisions"}],"predecessor-version":[{"id":9581,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/9573\/revisions\/9581"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}