{"action":"created","comment":{"url":"https://api.github.com/repos/fxbox/foxbox/pulls/comments/55297798","id":55297798,"diff_hunk":"@@ -0,0 +1,384 @@\n+//! An adapter providing time-related services, such as the current\n+//! timestamp or the current time of day.\n+\n+use adapt::*;\n+use utils::DispatchThread;\n+\n+use foxbox_taxonomy::values::{Value, ValDuration, TimeStamp};\n+use foxbox_taxonomy::services::*;\n+use foxbox_taxonomy::util::Id;\n+\n+use std::collections::{HashMap, HashSet};\n+\n+use chrono;\n+use chrono::*;\n+use timer;\n+\n+static ADAPTER_ID: &'static str = \"clock@link.mozilla.org\";\n+static ADAPTER_NAME: &'static str = \"Clock adapter (built-in)\";\n+static ADAPTER_VENDOR: &'static str = \"team@link.mozilla.org\";\n+static ADAPTER_VERSION: [u32;4] = [0, 0, 0, 0];\n+\n+const SERVICE_CLOCK_ID: &'static str = \"service:clock@link.mozilla.org\";\n+\n+const GETTER_TIMESTAMP_ID: &'static str = \"getter:timestamp.clock@link.mozilla.org\";\n+const GETTER_TIME_OF_DAY_ID: &'static str = \"getter:timeofday.clock@link.mozilla.org\";","path":"src/adapters/clock/mod.rs","position":25,"original_position":25,"commit_id":"a4aade43ab0e5c502dbcc9c88f4312b7fa83aac3","original_commit_id":"a4aade43ab0e5c502dbcc9c88f4312b7fa83aac3","user":{"login":"fabricedesre","id":984767,"avatar_url":"https://avatars.githubusercontent.com/u/984767?v=3","gravatar_id":"","url":"https://api.github.com/users/fabricedesre","html_url":"https://github.com/fabricedesre","followers_url":"https://api.github.com/users/fabricedesre/followers","following_url":"https://api.github.com/users/fabricedesre/following{/other_user}","gists_url":"https://api.github.com/users/fabricedesre/gists{/gist_id}","starred_url":"https://api.github.com/users/fabricedesre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabricedesre/subscriptions","organizations_url":"https://api.github.com/users/fabricedesre/orgs","repos_url":"https://api.github.com/users/fabricedesre/repos","events_url":"https://api.github.com/users/fabricedesre/events{/privacy}","received_events_url":"https://api.github.com/users/fabricedesre/received_events","type":"User","site_admin":false},"body":"Do these have to be global constants? or only unique for their service?","created_at":"2016-03-08T00:25:01Z","updated_at":"2016-03-08T00:25:01Z","html_url":"https://github.com/fxbox/foxbox/pull/128#discussion_r55297798","pull_request_url":"https://api.github.com/repos/fxbox/foxbox/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/comments/55297798"},"html":{"href":"https://github.com/fxbox/foxbox/pull/128#discussion_r55297798"},"pull_request":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/fxbox/foxbox/pulls/128","id":61565831,"html_url":"https://github.com/fxbox/foxbox/pull/128","diff_url":"https://github.com/fxbox/foxbox/pull/128.diff","patch_url":"https://github.com/fxbox/foxbox/pull/128.patch","issue_url":"https://api.github.com/repos/fxbox/foxbox/issues/128","number":128,"state":"open","locked":false,"title":"[RFC] Early prototype of a clock adapter.","user":{"login":"Yoric","id":10190,"avatar_url":"https://avatars.githubusercontent.com/u/10190?v=3","gravatar_id":"","url":"https://api.github.com/users/Yoric","html_url":"https://github.com/Yoric","followers_url":"https://api.github.com/users/Yoric/followers","following_url":"https://api.github.com/users/Yoric/following{/other_user}","gists_url":"https://api.github.com/users/Yoric/gists{/gist_id}","starred_url":"https://api.github.com/users/Yoric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yoric/subscriptions","organizations_url":"https://api.github.com/users/Yoric/orgs","repos_url":"https://api.github.com/users/Yoric/repos","events_url":"https://api.github.com/users/Yoric/events{/privacy}","received_events_url":"https://api.github.com/users/Yoric/received_events","type":"User","site_admin":false},"body":"First RFC of a clock adapter. At this stage, the adapter is not connected to the REST API. Indeed, the main idea is to test traits `Adapt` and `Adapter`.\r\n\r\nI hope to then be able to implement trait `Adapt` into something that will expose the clock as a REST (and later WebSocket) API.","created_at":"2016-03-03T14:24:53Z","updated_at":"2016-03-08T00:25:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc153eb5ec282b3dfc78fea7e0754d17f61f9b11","assignee":{"login":"fabricedesre","id":984767,"avatar_url":"https://avatars.githubusercontent.com/u/984767?v=3","gravatar_id":"","url":"https://api.github.com/users/fabricedesre","html_url":"https://github.com/fabricedesre","followers_url":"https://api.github.com/users/fabricedesre/followers","following_url":"https://api.github.com/users/fabricedesre/following{/other_user}","gists_url":"https://api.github.com/users/fabricedesre/gists{/gist_id}","starred_url":"https://api.github.com/users/fabricedesre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabricedesre/subscriptions","organizations_url":"https://api.github.com/users/fabricedesre/orgs","repos_url":"https://api.github.com/users/fabricedesre/repos","events_url":"https://api.github.com/users/fabricedesre/events{/privacy}","received_events_url":"https://api.github.com/users/fabricedesre/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/fxbox/foxbox/pulls/128/commits","review_comments_url":"https://api.github.com/repos/fxbox/foxbox/pulls/128/comments","review_comment_url":"https://api.github.com/repos/fxbox/foxbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fxbox/foxbox/issues/128/comments","statuses_url":"https://api.github.com/repos/fxbox/foxbox/statuses/a4aade43ab0e5c502dbcc9c88f4312b7fa83aac3","head":{"label":"fxbox:yoric-clock","ref":"yoric-clock","sha":"a4aade43ab0e5c502dbcc9c88f4312b7fa83aac3","user":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"repo":{"id":50702140,"name":"foxbox","full_name":"fxbox/foxbox","owner":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fxbox/foxbox","description":"The FoxBox daemon","fork":false,"url":"https://api.github.com/repos/fxbox/foxbox","forks_url":"https://api.github.com/repos/fxbox/foxbox/forks","keys_url":"https://api.github.com/repos/fxbox/foxbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fxbox/foxbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fxbox/foxbox/teams","hooks_url":"https://api.github.com/repos/fxbox/foxbox/hooks","issue_events_url":"https://api.github.com/repos/fxbox/foxbox/issues/events{/number}","events_url":"https://api.github.com/repos/fxbox/foxbox/events","assignees_url":"https://api.github.com/repos/fxbox/foxbox/assignees{/user}","branches_url":"https://api.github.com/repos/fxbox/foxbox/branches{/branch}","tags_url":"https://api.github.com/repos/fxbox/foxbox/tags","blobs_url":"https://api.github.com/repos/fxbox/foxbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fxbox/foxbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fxbox/foxbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/fxbox/foxbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fxbox/foxbox/statuses/{sha}","languages_url":"https://api.github.com/repos/fxbox/foxbox/languages","stargazers_url":"https://api.github.com/repos/fxbox/foxbox/stargazers","contributors_url":"https://api.github.com/repos/fxbox/foxbox/contributors","subscribers_url":"https://api.github.com/repos/fxbox/foxbox/subscribers","subscription_url":"https://api.github.com/repos/fxbox/foxbox/subscription","commits_url":"https://api.github.com/repos/fxbox/foxbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/fxbox/foxbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/fxbox/foxbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/fxbox/foxbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/fxbox/foxbox/contents/{+path}","compare_url":"https://api.github.com/repos/fxbox/foxbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fxbox/foxbox/merges","archive_url":"https://api.github.com/repos/fxbox/foxbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fxbox/foxbox/downloads","issues_url":"https://api.github.com/repos/fxbox/foxbox/issues{/number}","pulls_url":"https://api.github.com/repos/fxbox/foxbox/pulls{/number}","milestones_url":"https://api.github.com/repos/fxbox/foxbox/milestones{/number}","notifications_url":"https://api.github.com/repos/fxbox/foxbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fxbox/foxbox/labels{/name}","releases_url":"https://api.github.com/repos/fxbox/foxbox/releases{/id}","deployments_url":"https://api.github.com/repos/fxbox/foxbox/deployments","created_at":"2016-01-30T01:13:10Z","updated_at":"2016-03-07T10:09:29Z","pushed_at":"2016-03-07T23:35:24Z","git_url":"git://github.com/fxbox/foxbox.git","ssh_url":"git@github.com:fxbox/foxbox.git","clone_url":"https://github.com/fxbox/foxbox.git","svn_url":"https://github.com/fxbox/foxbox","homepage":null,"size":258,"stargazers_count":8,"watchers_count":8,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":35,"forks":27,"open_issues":35,"watchers":8,"default_branch":"master"}},"base":{"label":"fxbox:master","ref":"master","sha":"7a7e56f2476fcf021483d31ecfbd91d100b3c548","user":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"repo":{"id":50702140,"name":"foxbox","full_name":"fxbox/foxbox","owner":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fxbox/foxbox","description":"The FoxBox daemon","fork":false,"url":"https://api.github.com/repos/fxbox/foxbox","forks_url":"https://api.github.com/repos/fxbox/foxbox/forks","keys_url":"https://api.github.com/repos/fxbox/foxbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fxbox/foxbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fxbox/foxbox/teams","hooks_url":"https://api.github.com/repos/fxbox/foxbox/hooks","issue_events_url":"https://api.github.com/repos/fxbox/foxbox/issues/events{/number}","events_url":"https://api.github.com/repos/fxbox/foxbox/events","assignees_url":"https://api.github.com/repos/fxbox/foxbox/assignees{/user}","branches_url":"https://api.github.com/repos/fxbox/foxbox/branches{/branch}","tags_url":"https://api.github.com/repos/fxbox/foxbox/tags","blobs_url":"https://api.github.com/repos/fxbox/foxbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fxbox/foxbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fxbox/foxbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/fxbox/foxbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fxbox/foxbox/statuses/{sha}","languages_url":"https://api.github.com/repos/fxbox/foxbox/languages","stargazers_url":"https://api.github.com/repos/fxbox/foxbox/stargazers","contributors_url":"https://api.github.com/repos/fxbox/foxbox/contributors","subscribers_url":"https://api.github.com/repos/fxbox/foxbox/subscribers","subscription_url":"https://api.github.com/repos/fxbox/foxbox/subscription","commits_url":"https://api.github.com/repos/fxbox/foxbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/fxbox/foxbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/fxbox/foxbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/fxbox/foxbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/fxbox/foxbox/contents/{+path}","compare_url":"https://api.github.com/repos/fxbox/foxbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fxbox/foxbox/merges","archive_url":"https://api.github.com/repos/fxbox/foxbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fxbox/foxbox/downloads","issues_url":"https://api.github.com/repos/fxbox/foxbox/issues{/number}","pulls_url":"https://api.github.com/repos/fxbox/foxbox/pulls{/number}","milestones_url":"https://api.github.com/repos/fxbox/foxbox/milestones{/number}","notifications_url":"https://api.github.com/repos/fxbox/foxbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fxbox/foxbox/labels{/name}","releases_url":"https://api.github.com/repos/fxbox/foxbox/releases{/id}","deployments_url":"https://api.github.com/repos/fxbox/foxbox/deployments","created_at":"2016-01-30T01:13:10Z","updated_at":"2016-03-07T10:09:29Z","pushed_at":"2016-03-07T23:35:24Z","git_url":"git://github.com/fxbox/foxbox.git","ssh_url":"git@github.com:fxbox/foxbox.git","clone_url":"https://github.com/fxbox/foxbox.git","svn_url":"https://github.com/fxbox/foxbox","homepage":null,"size":258,"stargazers_count":8,"watchers_count":8,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":35,"forks":27,"open_issues":35,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/128"},"html":{"href":"https://github.com/fxbox/foxbox/pull/128"},"issue":{"href":"https://api.github.com/repos/fxbox/foxbox/issues/128"},"comments":{"href":"https://api.github.com/repos/fxbox/foxbox/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/fxbox/foxbox/statuses/a4aade43ab0e5c502dbcc9c88f4312b7fa83aac3"}}}}