When marijuana becomes a legal recreational drug in Canada, the Liberal government wants Canadians to be able to hold up to 30 grams without fear of running afoul of the law, Radio-Canada and CBC News have learned.

That is just one of several details about what will be included in the federal government's marijuana legislation, which is expected to be introduced on Thursday, according to a senior government source.

Other elements that will be contained in the upcoming bill include:

Introducing penalties for selling cannabis to minors and driving while under the influence of marijuana — both of which were contained in the Liberals' election platform.

Rules that will set limits on how marijuana products are marketed, which are expected to be similar to the limitations on alcohol and tobacco.

Funding for a public awareness campaign.

The approval of roadside saliva tests to detect drug use.

Drugged driving presents a particular challenge. The cannabis task force noted that roadside tests to determine whether a driver is impaired because of pot use are still in development. Public Safety Canada has been working with police in several cities to run pilot projects on different roadside detection tests.

As CBC News has previously reported, the Trudeau government's goal is to make legalization a reality in Canada on or before July 1, 2018.

Legalization was a Liberal campaign promise in the 2015 election campaign. Both as Liberal leader and later as prime minister, Justin Trudeau has pitched to Canadians that legalization will make it harder for young people to access pot and will take profits away from organized crime.

It's expected the government will follow a lot of the advice provided by the Task Force on Cannabis Legalization and Regulation.

According to recent reporting by CBC News, that will include:

A minimum age of 18 to buy marijuana, though provinces and territories will have the option of setting a higher age limit.

Allowing Canadians to grow four marijuana plants per household.

Licensing of producers, as well as ensuring the safety and security of the marijuana supply, will be a federal concern.

Provinces and territories will set the price for marijuana and decide how it is distributed and sold.

Much to discuss

Many of those suggestions will be hot topics of debate.

The Canadian Medical Association has suggested the legal age to buy marijuana should be 21, arguing that would limit damage to developing brains.

Home-growing is not a popular subject for the Canadian Association of Chiefs of Police. That group says it will put added demand on police and make it harder to keep the drug away from children.

Medical marijuana companies have seen their stocks surge and sometimes plunge along the path toward legalization in Canada.

However, both the chair of the government's task force and the parliamentary budget officer have warned that legalization won't necessarily be a major cash cow for governments, particularly in the first few years.

The prime minister has already suggested that any government revenues from marijuana sales won't go toward fattening the federal bank account. Instead, Trudeau has said the money could go toward addiction treatment, mental health support and education programs.