{ "type": "excalidraw", "version": 2, "source": "https://excalidraw.com", "elements": [ { "id": "dJewgM4vlOKFqP3DfneHr", "type": "rectangle", "x": 448, "y": 195, "width": 958, "height": 221, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1429718574, "version": 221, "versionNonce": 1800226350, "isDeleted": false, "boundElements": [ { "id": "KiOskcYXKIgFYxDZoeOUB", "type": "arrow" } ], "updated": 1651813101362, "link": null, "locked": false }, { "id": "B8Nx_UXF0MmGUeFq084pC", "type": "rectangle", "x": 573, "y": 272, "width": 233, "height": 123, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1442922162, "version": 256, "versionNonce": 366319666, "isDeleted": false, "boundElements": [ { "type": "text", "id": "hvQEnE9V_aePb6pswNpFp" }, { "id": "BT0DcOVI1uUbxA3hHsG74", "type": "arrow" } ], "updated": 1651813101362, "link": null, "locked": false }, { "id": "W3ktEM84xIbkhHsY8Ta0B", "type": "rectangle", "x": 1093, "y": 272, "width": 233, "height": 123, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 795959726, "version": 441, "versionNonce": 236239854, "isDeleted": false, "boundElements": [ { "type": "text", "id": "UtzvvkdIqIVlqzHo7LTgk" }, { "id": "BT0DcOVI1uUbxA3hHsG74", "type": "arrow" } ], "updated": 1651813101362, "link": null, "locked": false }, { "id": "hvQEnE9V_aePb6pswNpFp", "type": "text", "x": 578, "y": 320.5, "width": 223, "height": 26, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1599946862, "version": 21, "versionNonce": 256870322, "isDeleted": false, "boundElements": null, "updated": 1651814670754, "link": null, "locked": false, "text": "Reporter", "fontSize": 20, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 19, "containerId": "B8Nx_UXF0MmGUeFq084pC", "originalText": "Reporter" }, { "id": "UtzvvkdIqIVlqzHo7LTgk", "type": "text", "x": 1098, "y": 320.5, "width": 223, "height": 26, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 621292974, "version": 109, "versionNonce": 1027917486, "isDeleted": false, "boundElements": null, "updated": 1651814673781, "link": null, "locked": false, "text": "Listener", "fontSize": 20, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 19, "containerId": "W3ktEM84xIbkhHsY8Ta0B", "originalText": "Listener" }, { "id": "BT0DcOVI1uUbxA3hHsG74", "type": "arrow", "x": 824, "y": 334.6496792380025, "width": 254, "height": 4.2728075062007065, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "round", "seed": 719134638, "version": 255, "versionNonce": 2001541230, "isDeleted": false, "boundElements": null, "updated": 1651813101362, "link": null, "locked": false, "points": [ [ 0, 0 ], [ 254, -4.2728075062007065 ] ], "lastCommittedPoint": null, "startBinding": { "elementId": "B8Nx_UXF0MmGUeFq084pC", "focus": 0.05302900825033793, "gap": 18 }, "endBinding": { "elementId": "W3ktEM84xIbkhHsY8Ta0B", "focus": 0.08407265269340128, "gap": 15 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "db_DD10V0j2-vlLgcmLWm", "type": "text", "x": 926, "y": 297.5, "width": 57, "height": 26, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 121186738, "version": 71, "versionNonce": 1920488686, "isDeleted": false, "boundElements": null, "updated": 1651813101362, "link": null, "locked": false, "text": "Event", "fontSize": 20, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 19, "containerId": null, "originalText": "Event" }, { "id": "YdM2uzTBX2Xlnxj1zqzGS", "type": "line", "x": 1111, "y": 404, "width": 0.25462337024509907, "height": 57.54358908161521, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 2052093554, "version": 69, "versionNonce": 973490866, "isDeleted": false, "boundElements": null, "updated": 1651813101362, "link": null, "locked": false, "points": [ [ 0, 0 ], [ -0.25462337024509907, 57.54358908161521 ] ], "lastCommittedPoint": null, "startBinding": null, "endBinding": null, "startArrowhead": null, "endArrowhead": null }, { "id": "JoadpsFucSHjprjN2Ndr2", "type": "arrow", "x": 1110.6086901258677, "y": 467.0810657609254, "width": 45.28239898304332, "height": 0.044414640849765874, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1810710642, "version": 192, "versionNonce": 140407150, "isDeleted": false, "boundElements": null, "updated": 1651813101362, "link": null, "locked": false, "points": [ [ 0, 0 ], [ 45.28239898304332, -0.044414640849765874 ] ], "lastCommittedPoint": null, "startBinding": null, "endBinding": { "elementId": "9UIdqkSh2nEOhGG2RdkZx", "focus": 0.2836694332702034, "gap": 10.108910891088954 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "9UIdqkSh2nEOhGG2RdkZx", "type": "rectangle", "x": 1166, "y": 434, "width": 215, "height": 92, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 813014770, "version": 177, "versionNonce": 135144562, "isDeleted": false, "boundElements": [ { "id": "JoadpsFucSHjprjN2Ndr2", "type": "arrow" }, { "type": "text", "id": "CUOAGRf35Jhn6HCnc58m9" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "CUOAGRf35Jhn6HCnc58m9", "type": "text", "x": 1171, "y": 467, "width": 205, "height": 26, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 428361070, "version": 26, "versionNonce": 1655313326, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "EventHandler", "fontSize": 20, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 19, "containerId": "9UIdqkSh2nEOhGG2RdkZx", "originalText": "EventHandler" }, { "id": "P93ES64LnnFjhz8rJ2b-H", "type": "rectangle", "x": 1224, "y": 546, "width": 208, "height": 70, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 618197998, "version": 84, "versionNonce": 57984562, "isDeleted": false, "boundElements": [ { "type": "text", "id": "0ebQW_3PTXBQiB4AnQoLa" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "n1NgmyFco9CqxDMeD-FPZ", "type": "rectangle", "x": 1225, "y": 785, "width": 208, "height": 70, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 290512814, "version": 281, "versionNonce": 801598958, "isDeleted": false, "boundElements": [ { "id": "uP-KRi2rzVStgrecdaKOt", "type": "text" }, { "type": "text", "id": "uP-KRi2rzVStgrecdaKOt" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "ewHCxQiCAyx7ireMYKrlx", "type": "rectangle", "x": 1548, "y": 522, "width": 401, "height": 139, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1240255410, "version": 360, "versionNonce": 622931954, "isDeleted": false, "boundElements": [ { "id": "gFwKPsicinuox0y_KCIhM", "type": "arrow" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "d0jDp6ervlJSg7D1aG7GG", "type": "rectangle", "x": 1552, "y": 752, "width": 582.9999999999998, "height": 260, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 183791922, "version": 593, "versionNonce": 1981445746, "isDeleted": false, "boundElements": [ { "id": "gFwKPsicinuox0y_KCIhM", "type": "arrow" }, { "id": "HcNhQZntQuPP_6003BfTL", "type": "arrow" } ], "updated": 1651813368181, "link": null, "locked": false }, { "id": "0ebQW_3PTXBQiB4AnQoLa", "type": "text", "x": 1229, "y": 568, "width": 198, "height": 26, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 887189870, "version": 36, "versionNonce": 823812530, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "JsonPrinter", "fontSize": 20, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 19, "containerId": "P93ES64LnnFjhz8rJ2b-H", "originalText": "JsonPrinter" }, { "id": "uP-KRi2rzVStgrecdaKOt", "type": "text", "x": 1230, "y": 809.5, "width": 198, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 275823154, "version": 262, "versionNonce": 1299925614, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "ProgressBarHandler", "fontSize": 16, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 15, "containerId": "n1NgmyFco9CqxDMeD-FPZ", "originalText": "ProgressBarHandler" }, { "id": "cLc15IFKtFa08ug4DeZwb", "type": "rectangle", "x": 542, "y": -298, "width": 238, "height": 120.99999999999999, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 706336110, "version": 265, "versionNonce": 934223154, "isDeleted": false, "boundElements": [], "updated": 1651813101363, "link": null, "locked": false }, { "id": "99FMsvx5Iwz2GZXujolcm", "type": "rectangle", "x": 542, "y": -341, "width": 239, "height": 36, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 92561650, "version": 154, "versionNonce": 771270386, "isDeleted": false, "boundElements": [ { "type": "text", "id": "3xzk0emThMgxHIaBKlzfd" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "N1Gw-OPYZMuGFjIa-y2Fw", "type": "rectangle", "x": 577, "y": -164, "width": 206, "height": 31, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 629804014, "version": 240, "versionNonce": 1216280878, "isDeleted": false, "boundElements": [ { "id": "G63-IxVZQBcSTEwpySeX9", "type": "text" }, { "type": "text", "id": "G63-IxVZQBcSTEwpySeX9" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "Owf7WDIj_sdjNe3j0NFIw", "type": "rectangle", "x": 578, "y": -25, "width": 206, "height": 31, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 280271154, "version": 346, "versionNonce": 1038809266, "isDeleted": false, "boundElements": [ { "id": "3Hem7mUgPD-fzJYeCtEaf", "type": "text" }, { "id": "3Hem7mUgPD-fzJYeCtEaf", "type": "text" }, { "type": "text", "id": "3Hem7mUgPD-fzJYeCtEaf" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "3xzk0emThMgxHIaBKlzfd", "type": "text", "x": 547, "y": -336, "width": 229, "height": 26, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1072800750, "version": 80, "versionNonce": 618898286, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "derive(Serialize)", "fontSize": 20, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 19, "containerId": "99FMsvx5Iwz2GZXujolcm", "originalText": "derive(Serialize)" }, { "id": "G63-IxVZQBcSTEwpySeX9", "type": "text", "x": 582, "y": -159, "width": 196, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1491038706, "version": 167, "versionNonce": 1194136178, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "derive(Serialize)", "fontSize": 16, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 15, "containerId": "N1Gw-OPYZMuGFjIa-y2Fw", "originalText": "derive(Serialize)" }, { "id": "3Hem7mUgPD-fzJYeCtEaf", "type": "text", "x": 583, "y": -20, "width": 196, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1969375982, "version": 272, "versionNonce": 1538852270, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "derive(Serialize)", "fontSize": 16, "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle", "baseline": 15, "containerId": "Owf7WDIj_sdjNe3j0NFIw", "originalText": "derive(Serialize)" }, { "id": "aj0V7yzfzWlWqX20aJFmQ", "type": "rectangle", "x": 577, "y": -126, "width": 207, "height": 84, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 614518642, "version": 265, "versionNonce": 478540850, "isDeleted": false, "boundElements": [], "updated": 1651813101363, "link": null, "locked": false }, { "id": "Af98TrARR5ZF6lc4iJaQP", "type": "rectangle", "x": 579, "y": 12, "width": 205.99999999999997, "height": 116, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 859436658, "version": 480, "versionNonce": 1311252462, "isDeleted": false, "boundElements": [], "updated": 1651813101363, "link": null, "locked": false }, { "id": "_Rc_xblkOkzlnvocjNeLV", "type": "text", "x": 549, "y": -295, "width": 36, "height": 21, "angle": 0, "strokeColor": "#495057", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 908042290, "version": 157, "versionNonce": 1345974830, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "enum", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "enum" }, { "id": "1E8yw1SpqAKmS7lpL2yht", "type": "text", "x": 581, "y": -125, "width": 52, "height": 21, "angle": 0, "strokeColor": "#495057", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 873557042, "version": 334, "versionNonce": 1580732338, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "struct", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "struct" }, { "id": "WecWFwlGkg9PiD49LBSN5", "type": "text", "x": 583, "y": 13, "width": 36, "height": 21, "angle": 0, "strokeColor": "#495057", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 777806254, "version": 436, "versionNonce": 1289190510, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "enum", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "enum" }, { "id": "iTQj2zzhPK0V1N8uVnmV4", "type": "text", "x": 631, "y": -80.21428571428561, "width": 74, "height": 31.71428571428571, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1726661678, "version": 413, "versionNonce": 1351423218, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "current: u64\nmax: u64", "fontSize": 12.08163265306122, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 26.71428571428571, "containerId": null, "originalText": "current: u64\nmax: u64" }, { "id": "eleEGepT3in4MDbhCBYvj", "type": "text", "x": 633, "y": 57.78571428571439, "width": 71, "height": 51, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 738196462, "version": 594, "versionNonce": 439380782, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "Downloading,\nInstalling,\nRunning,", "fontSize": 12.08163265306122, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 46, "containerId": null, "originalText": "Downloading,\nInstalling,\nRunning," }, { "id": "nwT3GODGeMRszP1TbXVzP", "type": "text", "x": 1256, "y": 495.8863636363636, "width": 77.99999999999996, "height": 18.613636363636356, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 631808430, "version": 181, "versionNonce": 1670829422, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "Event -> ()", "fontSize": 14.181818181818175, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 13.613636363636356, "containerId": null, "originalText": "Event -> ()" }, { "id": "gFwKPsicinuox0y_KCIhM", "type": "arrow", "x": 1454, "y": 584, "width": 66.34790772724546, "height": 4.173002551557033, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 421720174, "version": 239, "versionNonce": 1711145074, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "points": [ [ 0, 0 ], [ 66.34790772724546, 4.173002551557033 ] ], "lastCommittedPoint": null, "startBinding": null, "endBinding": { "elementId": "ewHCxQiCAyx7ireMYKrlx", "gap": 27.65209227275441, "focus": -0.13391165804833272 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "HcNhQZntQuPP_6003BfTL", "type": "arrow", "x": 1454, "y": 815, "width": 66, "height": 16.4705893317182, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 185440942, "version": 476, "versionNonce": 807010158, "isDeleted": false, "boundElements": null, "updated": 1651813368181, "link": null, "locked": false, "points": [ [ 0, 0 ], [ 66, 16.4705893317182 ] ], "lastCommittedPoint": null, "startBinding": null, "endBinding": { "elementId": "d0jDp6ervlJSg7D1aG7GG", "gap": 32, "focus": -0.14948601377599144 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "ASai5C3RquUbz4ZgDejay", "type": "text", "x": 1561, "y": 523.5, "width": 263, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 85685746, "version": 51, "versionNonce": 1325998642, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "impl EventHandler for JsonPrinter", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "impl EventHandler for JsonPrinter" }, { "id": "q7NABDTt3rgjU0RU61cUS", "type": "text", "x": 1565, "y": 759.5, "width": 327, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 810578734, "version": 185, "versionNonce": 319093234, "isDeleted": false, "boundElements": null, "updated": 1651813248378, "link": null, "locked": false, "text": "impl EventHandler for ProgressBarHandler", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "impl EventHandler for ProgressBarHandler" }, { "id": "f4p1RkbyJHZay3BqHsn4z", "type": "text", "x": 1591, "y": 541.5, "width": 161, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 701881838, "version": 29, "versionNonce": 902433778, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "type Event = Event;", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "type Event = Event;" }, { "id": "n_g6qlyObJUMNHCLDJJjF", "type": "text", "x": 1595, "y": 777.5, "width": 161, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 294002354, "version": 139, "versionNonce": 967048302, "isDeleted": false, "boundElements": null, "updated": 1651813240037, "link": null, "locked": false, "text": "type Event = Event;", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "type Event = Event;" }, { "id": "eTFvCJSnCcpRwQJmfaPl2", "type": "text", "x": 1595, "y": 569.5, "width": 196, "height": 105, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 935210670, "version": 71, "versionNonce": 882664046, "isDeleted": false, "boundElements": null, "updated": 1651813504317, "link": null, "locked": false, "text": "fn handle(&self, event) {\n\n\n}\n", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 99, "containerId": null, "originalText": "fn handle(&self, event) {\n\n\n}\n" }, { "id": "aIEjw_wvJj5k9Zdl6dmuo", "type": "text", "x": 1598, "y": 805.5, "width": 196, "height": 42, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1215683950, "version": 176, "versionNonce": 672541170, "isDeleted": false, "boundElements": null, "updated": 1651813487361, "link": null, "locked": false, "text": "fn handle(&self, event) {\n", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 36, "containerId": null, "originalText": "fn handle(&self, event) {\n" }, { "id": "KsePzHR-BtOfo-b4YVhjj", "type": "text", "x": 1613, "y": 594.5, "width": 313, "height": 42, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1890967662, "version": 231, "versionNonce": 238115954, "isDeleted": false, "boundElements": null, "updated": 1651813264899, "link": null, "locked": false, "text": "let json = serde_json::to_string(event);\nwriteln!(stderr, \"{}\", json);", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 36, "containerId": null, "originalText": "let json = serde_json::to_string(event);\nwriteln!(stderr, \"{}\", json);" }, { "id": "c1TtSUywFnoRuSRg4o4IA", "type": "text", "x": 1617, "y": 830.5, "width": 417, "height": 168, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 141785202, "version": 614, "versionNonce": 1997297518, "isDeleted": false, "boundElements": null, "updated": 1651813476945, "link": null, "locked": false, "text": "match event {\n MyEvent::Progress(Progress { current, max }) => {\n self.bar.set_progress(current, max)\n }\n MyEvent::Update(update) => {\n self.bar.reset()\n }\n}", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 162, "containerId": null, "originalText": "match event {\n MyEvent::Progress(Progress { current, max }) => {\n self.bar.set_progress(current, max)\n }\n MyEvent::Update(update) => {\n self.bar.reset()\n }\n}" }, { "id": "dAAPounfvcq3wshQ8VQ72", "type": "text", "x": 1231, "y": 544.5, "width": 52, "height": 21, "angle": 0, "strokeColor": "#495057", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1181058034, "version": 93, "versionNonce": 1734454894, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "struct", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "struct" }, { "id": "mT-1UxjA8MATi7AQACTYd", "type": "text", "x": 1233, "y": 788.5, "width": 52, "height": 21, "angle": 0, "strokeColor": "#495057", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 241770738, "version": 188, "versionNonce": 2074687346, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "struct", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "struct" }, { "id": "wg06TNnOlLvqSArYrIHlW", "type": "text", "x": 566, "y": -274.5, "width": 65, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 2026439534, "version": 97, "versionNonce": 1480437934, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "MyEvent", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "MyEvent" }, { "id": "U0zKf3uKp5YY5D_-XTqKw", "type": "text", "x": 590, "y": -252.5, "width": 167, "height": 42, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 331322094, "version": 171, "versionNonce": 406157618, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "Progress(Progression)\nUpdate(Update)", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 36, "containerId": null, "originalText": "Progress(Progression)\nUpdate(Update)" }, { "id": "ZejNsFs23UIA3UcB-KLzq", "type": "text", "x": 610, "y": -105.5, "width": 88, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1003383726, "version": 178, "versionNonce": 1256155886, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "Progression", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "Progression" }, { "id": "oRGXwFLk595GqOd7QWx2u", "type": "text", "x": 612, "y": 32.5, "width": 58, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "#ced4da", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 285245938, "version": 284, "versionNonce": 1699971826, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "Update", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "Update" }, { "id": "h1gpfTMAK7TCF5udXe8Jc", "type": "rectangle", "x": 448, "y": -422, "width": 448, "height": 613, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 2125540722, "version": 98, "versionNonce": 1842339118, "isDeleted": false, "boundElements": [ { "id": "FJEqxTPKZbSJ_6gRHan2H", "type": "arrow" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "FJEqxTPKZbSJ_6gRHan2H", "type": "arrow", "x": 1028.4959045313299, "y": -195.19236817583442, "width": 113.49590453132987, "height": 8.192368175834417, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 769246894, "version": 146, "versionNonce": 2106217650, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "points": [ [ 0, 0 ], [ -113.49590453132987, 8.192368175834417 ] ], "lastCommittedPoint": null, "startBinding": null, "endBinding": { "elementId": "h1gpfTMAK7TCF5udXe8Jc", "focus": -0.16722956344199902, "gap": 19 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "KiOskcYXKIgFYxDZoeOUB", "type": "arrow", "x": 1110.9195058954115, "y": 85.8167478516698, "width": 14.70081934828113, "height": 86.40156867727636, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1906313134, "version": 507, "versionNonce": 913835886, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "points": [ [ 0, 0 ], [ -14.70081934828113, 86.40156867727636 ] ], "lastCommittedPoint": null, "startBinding": { "elementId": "E007zBvKyJDHBe6KxBLpg", "focus": 0.7376580563546651, "gap": 11.316747851669803 }, "endBinding": { "elementId": "dJewgM4vlOKFqP3DfneHr", "focus": 0.29437751426080855, "gap": 22.78168347105384 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "u-HpVzqshuoGF_42CxBEu", "type": "arrow", "x": 1551.7216728593933, "y": 278.8167478516698, "width": 15.691663024665786, "height": 128.40156867727632, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1434062382, "version": 806, "versionNonce": 310439538, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "points": [ [ 0, 0 ], [ -15.691663024665786, 128.40156867727632 ] ], "lastCommittedPoint": null, "startBinding": { "elementId": "s2w7Kkm0o60v8NfcJzQUm", "focus": 0.7376580563546649, "gap": 11.316747851669788 }, "endBinding": { "elementId": "MQRxJQakx90MGMs8GlcZu", "focus": -0.2267261268199776, "gap": 18.78168347105384 }, "startArrowhead": null, "endArrowhead": "arrow" }, { "id": "e1zIMSMXfwqRXkjfCdhsT", "type": "text", "x": 1046, "y": -212.5, "width": 272, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 489256238, "version": 77, "versionNonce": 86043054, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "An example instance of an \"Event\"", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "An example instance of an \"Event\"" }, { "id": "E007zBvKyJDHBe6KxBLpg", "type": "text", "x": 1063, "y": 11.5, "width": 451, "height": 63, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 991674610, "version": 393, "versionNonce": 150884402, "isDeleted": false, "boundElements": [ { "id": "KiOskcYXKIgFYxDZoeOUB", "type": "arrow" } ], "updated": 1651813101363, "link": null, "locked": false, "text": "A communication channel\nbetween a transmitter (Reporter) and receiver (Listener)\nmessages on the channel are called Events", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 57, "containerId": null, "originalText": "A communication channel\nbetween a transmitter (Reporter) and receiver (Listener)\nmessages on the channel are called Events" }, { "id": "s2w7Kkm0o60v8NfcJzQUm", "type": "text", "x": 1516, "y": 246.5, "width": 299, "height": 21, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1637331890, "version": 542, "versionNonce": 1223918574, "isDeleted": false, "boundElements": [ { "id": "u-HpVzqshuoGF_42CxBEu", "type": "arrow" } ], "updated": 1651813101363, "link": null, "locked": false, "text": "EventHandlers act on received events", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "EventHandlers act on received events" }, { "id": "MQRxJQakx90MGMs8GlcZu", "type": "rectangle", "x": 1086, "y": 426, "width": 1077, "height": 663, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 2145728494, "version": 215, "versionNonce": 1430875058, "isDeleted": false, "boundElements": [ { "id": "u-HpVzqshuoGF_42CxBEu", "type": "arrow" } ], "updated": 1651813101363, "link": null, "locked": false }, { "id": "EvN5RXUodPNPCY4CadUkd", "type": "text", "x": 1192, "y": 83.5, "width": 884, "height": 63, "angle": 0, "strokeColor": "#888", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 2102657710, "version": 470, "versionNonce": 253354094, "isDeleted": false, "boundElements": null, "updated": 1651813101363, "link": null, "locked": false, "text": "In the included ChannelReporter and ChannelEventListener implementations, we use a crossbeam channel to send\nevents from the reporter to the listener. The listener runs in a separate thread, to keep it from blocking the\nthe program flow.", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 57, "containerId": null, "originalText": "In the included ChannelReporter and ChannelEventListener implementations, we use a crossbeam channel to send\nevents from the reporter to the listener. The listener runs in a separate thread, to keep it from blocking the\nthe program flow." }, { "id": "rIEXWzMOosvJiucbUWtZk", "type": "text", "x": 1594, "y": 278.5, "width": 598, "height": 21, "angle": 0, "strokeColor": "#888", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 198947310, "version": 822, "versionNonce": 723917102, "isDeleted": false, "boundElements": null, "updated": 1651813135118, "link": null, "locked": false, "text": "For example, here we have a JsonPrinter which prints json serialized events", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 15, "containerId": null, "originalText": "For example, here we have a JsonPrinter which prints json serialized events" }, { "id": "6sCAHR1XiGdCYPqcoBfGk", "type": "text", "x": 1595, "y": 305.5, "width": 617, "height": 42, "angle": 0, "strokeColor": "#888", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 685250418, "version": 983, "versionNonce": 1007202034, "isDeleted": false, "boundElements": null, "updated": 1651813212984, "link": null, "locked": false, "text": "In the second example we have a progress bar which we update based on the\nreceived events. ", "fontSize": 16, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 36, "containerId": null, "originalText": "In the second example we have a progress bar which we update based on the\nreceived events. " }, { "id": "IeYhnb8tFHtphJz8aoDHF", "type": "text", "x": 1252, "y": 834.1444444444444, "width": 118, "height": 18.35555555555556, "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 1349582386, "version": 179, "versionNonce": 1104088558, "isDeleted": false, "boundElements": null, "updated": 1651813313019, "link": null, "locked": false, "text": "bar: ProgressBar", "fontSize": 13.985185185185182, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 13.355555555555561, "containerId": null, "originalText": "bar: ProgressBar" }, { "id": "eAjpgG772qYMxHRN9gCAX", "type": "text", "x": 454, "y": 432.5716560509554, "width": 618, "height": 840, "angle": 0, "strokeColor": "#888", "backgroundColor": "transparent", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "dashed", "roughness": 1, "opacity": 100, "groupIds": [], "strokeSharpness": "sharp", "seed": 335668398, "version": 916, "versionNonce": 1971883694, "isDeleted": false, "boundElements": null, "updated": 1651814690040, "link": null, "locked": false, "text": "type MyReporter = ChannelReporter;\n\nfn main() {\n // setup\n let (event_sender, event_receiver) = event_channel();\n let (disconnect_sender, disconnect_receiver) = disconnect_channel();\n \n let reporter = ChannelReporter::new(event_sender, disconnect_receiver);\n let listener = ChannelEventListener::new(event_receiver, disconnect_sender);\n \n // spins up a second thread, so we don't block here!\n listener.run_handler(ProgressBarHandler::default());\n \n // continue with regular program logic\n my_program_logic(&reporter);\n}\n\n\nfn my_program_logic(reporter: &MyReporter) {\n // ... inform user we're doing important work!\n reporter.report_event(MyEvent::Update(Update::Downloading));\n \n // ... program goes brrrr\n work(reporter);\n \n // ... inform user about progress\n reporter.report_event(MyEvent::Update(Update::Installing));\n\n // ... more work\n work(reporter);\n\n // ... inform user about progress\n reporter.report_event(MyEvent::Update(Update::Running));\n}\n\nfn work(reporter: &MyReporter) {\n thread::sleep(Duration::from_secs(1));\n reporter.report_event(MyEvent::Progress(Progression { current: 50, max 100 }));\n thread::sleep(Duration::from_secs(1));\n reporter.report_event(MyEvent::Progress(Progression { current: 100, max 100 }));\n thread::sleep(Duration::from_secs(1);\n}", "fontSize": 14.929936305732483, "fontFamily": 1, "textAlign": "left", "verticalAlign": "top", "baseline": 834, "containerId": null, "originalText": "type MyReporter = ChannelReporter;\n\nfn main() {\n // setup\n let (event_sender, event_receiver) = event_channel();\n let (disconnect_sender, disconnect_receiver) = disconnect_channel();\n \n let reporter = ChannelReporter::new(event_sender, disconnect_receiver);\n let listener = ChannelEventListener::new(event_receiver, disconnect_sender);\n \n // spins up a second thread, so we don't block here!\n listener.run_handler(ProgressBarHandler::default());\n \n // continue with regular program logic\n my_program_logic(&reporter);\n}\n\n\nfn my_program_logic(reporter: &MyReporter) {\n // ... inform user we're doing important work!\n reporter.report_event(MyEvent::Update(Update::Downloading));\n \n // ... program goes brrrr\n work(reporter);\n \n // ... inform user about progress\n reporter.report_event(MyEvent::Update(Update::Installing));\n\n // ... more work\n work(reporter);\n\n // ... inform user about progress\n reporter.report_event(MyEvent::Update(Update::Running));\n}\n\nfn work(reporter: &MyReporter) {\n thread::sleep(Duration::from_secs(1));\n reporter.report_event(MyEvent::Progress(Progression { current: 50, max 100 }));\n thread::sleep(Duration::from_secs(1));\n reporter.report_event(MyEvent::Progress(Progression { current: 100, max 100 }));\n thread::sleep(Duration::from_secs(1);\n}" } ], "appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" }, "files": {} }